diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-29 01:56:42 +0000 |
---|---|---|
committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2024-01-30 17:28:03 +0000 |
commit | a01f1d9e834719046fbdec02a5147d2e55722bac (patch) | |
tree | 58475e7704f486890246e4f3ae3b4e5031e668eb /gfx/gl/sceneRenderer.cpp | |
parent | Set shadow program uniforms all in one function, merge setting of view projec... (diff) | |
download | ilt-a01f1d9e834719046fbdec02a5147d2e55722bac.tar.bz2 ilt-a01f1d9e834719046fbdec02a5147d2e55722bac.tar.xz ilt-a01f1d9e834719046fbdec02a5147d2e55722bac.zip |
Remove the complications from previously storing several shadow maps in the texture
Diffstat (limited to 'gfx/gl/sceneRenderer.cpp')
-rw-r--r-- | gfx/gl/sceneRenderer.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gfx/gl/sceneRenderer.cpp b/gfx/gl/sceneRenderer.cpp index b60d9af..2dd1760 100644 --- a/gfx/gl/sceneRenderer.cpp +++ b/gfx/gl/sceneRenderer.cpp @@ -116,7 +116,7 @@ SceneRenderer::setDirectionalLight(const RGB & colour, const Direction3D & direc glBindFramebuffer(GL_FRAMEBUFFER, gBufferIll); glViewport(0, 0, size.x, size.y); dirLight.use(); - dirLight.setDirectionalLight(colour, direction, camera.getPosition(), lvp.projections, lvp.regions, lvp.maps); + dirLight.setDirectionalLight(colour, direction, camera.getPosition(), lvp); renderQuad(); } } @@ -133,21 +133,18 @@ SceneRenderer::DirectionalLightProgram::DirectionalLightProgram() : Program {lighting_vs, directionalLight_fs}, directionLoc {*this, "lightDirection"}, colourLoc {*this, "lightColour"}, lightPointLoc {*this, "lightPoint"}, lightViewProjectionLoc {*this, "lightViewProjection"}, - lightViewProjectionCountLoc {*this, "lightViewProjectionCount"}, - lightViewShadowMapRegionLoc {*this, "shadowMapRegion"} + lightViewProjectionCountLoc {*this, "lightViewProjectionCount"} { } void -SceneRenderer::DirectionalLightProgram::setDirectionalLight(const RGB & c, const Direction3D & d, - const GlobalPosition3D & p, const std::span<const glm::mat4x4> lvp, - const std::span<const TextureRelRegion> shadowMapRegions, std::size_t maps) const +SceneRenderer::DirectionalLightProgram::setDirectionalLight( + const RGB & c, const Direction3D & d, const GlobalPosition3D & p, const std::span<const glm::mat4x4> lvp) const { glUniform(colourLoc, c); const auto nd = glm::normalize(d); glUniform(directionLoc, nd); glUniform(lightPointLoc, p); - glUniform(lightViewProjectionCountLoc, static_cast<GLuint>(maps)); + glUniform(lightViewProjectionCountLoc, static_cast<GLuint>(lvp.size())); glUniform(lightViewProjectionLoc, lvp); - glUniform(lightViewShadowMapRegionLoc, shadowMapRegions); } |