From e58e8f2eb6687f54244bd7e551177124ddab6ba3 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 29 Nov 2017 15:23:31 -0500 Subject: [PATCH] clear color and depth of reflection at same time --- source/src/rendergl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index c9ec853f..a78bab25 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -666,8 +666,6 @@ void drawreflection(float hf, int w, int h, float changelod, bool refract) glEnable(GL_SCISSOR_TEST); } - glClear(GL_COLOR_BUFFER_BIT); // Fix HUD components appearing in reflection - resetcubes(); render_world(camera1->o.x, camera1->o.y, refract ? camera1->o.z : hf, changelod, @@ -677,7 +675,7 @@ void drawreflection(float hf, int w, int h, float changelod, bool refract) if(!refract) glCullFace(GL_BACK); glViewport(0, 0, size, size); - glClear(GL_DEPTH_BUFFER_BIT); + glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); glEnable(GL_TEXTURE_2D);