summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/sceneRenderer.cpp')
-rw-r--r--gfx/gl/sceneRenderer.cpp10
1 files changed, 5 insertions, 5 deletions
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<const glm::mat4x4> lvp) const
+SceneRenderer::DirectionalLightProgram::setDirectionalLight(const glm::vec3 & c, const glm::vec3 & d,
+ const std::span<const glm::mat4x4> lvp, const std::span<const glm::vec4> 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<GLuint>(lvp.size()));
glUniformMatrix4fv(lightViewProjectionLoc, static_cast<GLsizei>(lvp.size()), GL_FALSE, glm::value_ptr(lvp.front()));
- glUniform4fv(lightViewShadowMapRegionLoc, 1, glm::value_ptr(shadowMapRegions));
+ glUniform4fv(lightViewShadowMapRegionLoc, static_cast<GLsizei>(shadowMapRegions.size()),
+ glm::value_ptr(shadowMapRegions.front()));
}