summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneRenderer.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-12-30 14:56:13 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-12-30 14:56:13 +0000
commita0257a4e8330da9c00fe009ede978a4a9fb85793 (patch)
treef97737de597f45fab2371a8b65fe01be3ef23d3b /gfx/gl/sceneRenderer.cpp
parentMove test render helpers into a new test library (diff)
downloadilt-a0257a4e8330da9c00fe009ede978a4a9fb85793.tar.bz2
ilt-a0257a4e8330da9c00fe009ede978a4a9fb85793.tar.xz
ilt-a0257a4e8330da9c00fe009ede978a4a9fb85793.zip
Add directional light to pointlight test, fix setting of GL_DEPTH_TEST
Fixes issue where directional light prevented pointlights from working
Diffstat (limited to 'gfx/gl/sceneRenderer.cpp')
-rw-r--r--gfx/gl/sceneRenderer.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/gfx/gl/sceneRenderer.cpp b/gfx/gl/sceneRenderer.cpp
index de96571..ee6d927 100644
--- a/gfx/gl/sceneRenderer.cpp
+++ b/gfx/gl/sceneRenderer.cpp
@@ -74,8 +74,6 @@ SceneRenderer::render(const SceneProvider & scene) const
// Illumination pass
glDrawBuffer(GL_COLOR_ATTACHMENT3);
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, gPosition);
@@ -84,6 +82,7 @@ SceneRenderer::render(const SceneProvider & scene) const
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, shadowMapper);
scene.environment(shader, *this);
+ glDisable(GL_DEPTH_TEST);
scene.lights(shader);
// Lighting pass
@@ -123,7 +122,6 @@ SceneRenderer::setDirectionalLight(
glBindVertexArray(displayVAO);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glBindVertexArray(0);
- glEnable(GL_DEPTH_TEST);
}
}