diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-04 17:16:31 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-04 17:16:31 +0000 |
commit | 6433b56c3af8721f8301255818a8dd692e75492e (patch) | |
tree | 46471356f76e4dc66746fa4133c928609b5c0620 /gfx/gl/sceneRenderer.h | |
parent | Fixed point shadow shader doesn't need normal/texture data (diff) | |
download | ilt-6433b56c3af8721f8301255818a8dd692e75492e.tar.bz2 ilt-6433b56c3af8721f8301255818a8dd692e75492e.tar.xz ilt-6433b56c3af8721f8301255818a8dd692e75492e.zip |
Generate and use a shadow map
Generated when the directional light is specified in the environment call, passed to the directional
light shader pass to conditionally illuminate each pixel.
Diffstat (limited to 'gfx/gl/sceneRenderer.h')
-rw-r--r-- | gfx/gl/sceneRenderer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gfx/gl/sceneRenderer.h b/gfx/gl/sceneRenderer.h index 736b15a..d7a92b7 100644 --- a/gfx/gl/sceneRenderer.h +++ b/gfx/gl/sceneRenderer.h @@ -5,6 +5,7 @@ #include "program.h" #include "sceneProvider.h" #include "sceneShader.h" +#include "shadowMapper.h" #include <functional> #include <glm/fwd.hpp> @@ -14,7 +15,7 @@ public: void render(const SceneProvider &) const; void setAmbientLight(const glm::vec3 & colour) const; - void setDirectionalLight(const glm::vec3 & colour, const glm::vec3 & direction) const; + void setDirectionalLight(const glm::vec3 & colour, const glm::vec3 & direction, const SceneProvider &) const; Camera camera; @@ -34,10 +35,10 @@ private: DirectionalLightProgram(); using Program::use; - void setDirectionalLight(const glm::vec3 &, const glm::vec3 &) const; + void setDirectionalLight(const glm::vec3 &, const glm::vec3 &, const glm::mat4x4 &) const; private: - RequiredUniformLocation directionLoc, colourLoc; + RequiredUniformLocation directionLoc, colourLoc, lightViewProjectionLoc; }; DeferredLightProgram lighting; @@ -45,4 +46,5 @@ private: glVertexArray displayVAO; glBuffer displayVBO; SceneShader shader; + ShadowMapper shadowMapper; }; |