From aaff59af171545cc16632881aefb19449a7c491a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 28 Dec 2022 19:29:53 +0000 Subject: Generate a single shadow band and region definition --- gfx/gl/sceneRenderer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gfx/gl/sceneRenderer.cpp') diff --git a/gfx/gl/sceneRenderer.cpp b/gfx/gl/sceneRenderer.cpp index 0fcf471..b13da35 100644 --- a/gfx/gl/sceneRenderer.cpp +++ b/gfx/gl/sceneRenderer.cpp @@ -119,7 +119,7 @@ SceneRenderer::setDirectionalLight( glBindFramebuffer(GL_FRAMEBUFFER, gBuffer); glViewport(0, 0, size.x, size.y); dirLight.use(); - dirLight.setDirectionalLight(colour, direction, lvp); + dirLight.setDirectionalLight(colour, direction, lvp.projections, lvp.regions); glBindVertexArray(displayVAO); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glBindVertexArray(0); @@ -136,14 +136,14 @@ SceneRenderer::DirectionalLightProgram::DirectionalLightProgram() : } void -SceneRenderer::DirectionalLightProgram::setDirectionalLight( - const glm::vec3 & c, const glm::vec3 & d, const std::span lvp) const +SceneRenderer::DirectionalLightProgram::setDirectionalLight(const glm::vec3 & c, const glm::vec3 & d, + const std::span lvp, const std::span shadowMapRegions) const { - constexpr glm::vec4 shadowMapRegions {0.5F, 0.5F, 0.5F, 0.5F}; glUniform3fv(colourLoc, 1, glm::value_ptr(c)); const auto nd = glm::normalize(d); glUniform3fv(directionLoc, 1, glm::value_ptr(nd)); glUniform1ui(lightViewProjectionCountLoc, static_cast(lvp.size())); glUniformMatrix4fv(lightViewProjectionLoc, static_cast(lvp.size()), GL_FALSE, glm::value_ptr(lvp.front())); - glUniform4fv(lightViewShadowMapRegionLoc, 1, glm::value_ptr(shadowMapRegions)); + glUniform4fv(lightViewShadowMapRegionLoc, static_cast(shadowMapRegions.size()), + glm::value_ptr(shadowMapRegions.front())); } -- cgit v1.2.3