From 6433b56c3af8721f8301255818a8dd692e75492e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 4 Dec 2022 17:16:31 +0000 Subject: 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. --- gfx/gl/sceneRenderer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gfx/gl/sceneRenderer.h') 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 #include @@ -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; }; -- cgit v1.2.3