From c2d669e5b39b1f60ec98eb51f9bf2444399c96e1 Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Mon, 9 Mar 2015 14:59:22 +0100 Subject: [PATCH] Fixing waterPlane not being rendered last, leading to incorrect alpha. --- level.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/level.cc b/level.cc index f9abdcb..ec7eaf7 100644 --- a/level.cc +++ b/level.cc @@ -19,8 +19,8 @@ Level::~Level() { } for(unsigned int i = 0; irender(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); - waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); } else { objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs); } } + if (lightingPass) { + waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); + } } void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed) {