diff options
| author | Miles Macklin <[email protected]> | 2018-03-19 15:10:24 +1300 |
|---|---|---|
| committer | Miles Macklin <[email protected]> | 2018-03-19 15:10:24 +1300 |
| commit | 8ee05c79ae1748ef132a12e4fb0af284899faec6 (patch) | |
| tree | 82bd5aa1892e28ce7886b6cfeafe66a47ff38e67 /demo/shaders.h | |
| parent | Flex 1.2 (beta 2) (diff) | |
| download | flex-8ee05c79ae1748ef132a12e4fb0af284899faec6.tar.xz flex-8ee05c79ae1748ef132a12e4fb0af284899faec6.zip | |
Flex 1.2.0 release
Diffstat (limited to 'demo/shaders.h')
| -rw-r--r-- | demo/shaders.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/demo/shaders.h b/demo/shaders.h index 168a333..05dc911 100644 --- a/demo/shaders.h +++ b/demo/shaders.h @@ -93,6 +93,48 @@ void ShadowDestroy(ShadowMap* map); void ShadowBegin(ShadowMap* map); void ShadowEnd(); +struct RenderTexture; +RenderTexture* CreateRenderTexture(const char* filename); +RenderTexture* CreateRenderTarget(int with, int height, bool depth); +void DestroyRenderTexture(RenderTexture* tex); + +void SetRenderTarget(RenderTexture* target); + +struct RenderMaterial +{ + RenderMaterial() + { + frontColor = 0.5f;//Vec4(SrgbToLinear(Colour(71.0f/255.0f, 165.0f/255.0f, 1.0f))); + backColor = 0.5f;//Vec4(SrgbToLinear(Colour(165.0f/255.0f, 71.0f/255.0f, 1.0f))); + + roughness = 0.5f; + metallic = 0.0f; + specular = 0.5f; + + colorTex = NULL; + + hidden = false; + } + + Vec3 frontColor; + Vec3 backColor; + + float roughness; + float metallic; + float specular; + + bool hidden; + + RenderTexture* colorTex; +}; + + +struct RenderMesh; +RenderMesh* CreateRenderMesh(const Mesh* m); +void DestroyRenderMesh(RenderMesh* m); +void DrawRenderMesh(RenderMesh* m, const Matrix44& xform, const RenderMaterial& mat); +void DrawRenderMeshInstances(RenderMesh* m, const Matrix44* xforms, int n, const RenderMaterial& mat); + // primitive draw methods void DrawPlanes(Vec4* planes, int n, float bias); void DrawPoints(FluidRenderBuffers* buffer, int n, int offset, float radius, float screenWidth, float screenAspect, float fov, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowTex, bool showDensity); @@ -112,6 +154,7 @@ void DrawGpuMeshInstances(GpuMesh* m, const Matrix44* xforms, int n, const Vec3& void BindSolidShader(Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowTex, float bias, Vec4 fogColor); void UnbindSolidShader(); + float RendererGetDeviceTimestamps(unsigned long long* begin, unsigned long long* end, unsigned long long* freq); void* GetGraphicsCommandQueue(); void GraphicsTimerBegin(); @@ -162,5 +205,4 @@ void RenderEllipsoids(FluidRenderer* render, FluidRenderBuffers* buffers, int n, void RenderDiffuse(FluidRenderer* render, DiffuseRenderBuffers* buffer, int n, float radius, float screenWidth, float screenAspect, float fov, Vec4 color, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowTex, float motionBlur, float inscatter, float outscatter, bool shadow, bool front); // UI rendering - void DrawImguiGraph(); |