summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/sceneRenderer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/sceneRenderer.cpp b/ui/sceneRenderer.cpp
index c3cff7a..2202906 100644
--- a/ui/sceneRenderer.cpp
+++ b/ui/sceneRenderer.cpp
@@ -107,11 +107,13 @@ SceneRenderer::setAmbientLight(const glm::vec3 & colour) const
void
SceneRenderer::setDirectionalLight(const glm::vec3 & colour, const glm::vec3 & direction) const
{
- dirLight.use();
- dirLight.setDirectionalLight(colour, direction);
- glBindVertexArray(displayVAO);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- glBindVertexArray(0);
+ if (colour.r > 0 || colour.g > 0 || colour.b > 0) {
+ dirLight.use();
+ dirLight.setDirectionalLight(colour, direction);
+ glBindVertexArray(displayVAO);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ glBindVertexArray(0);
+ }
}
SceneRenderer::DirectionalLightProgram::DirectionalLightProgram() :