From 1aca4a9ff5a4c42127c2107c77a2e7c3edb2347c Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 30 Jun 2019 15:42:22 +0800 Subject: [PATCH] Fix artifacts in the begining of race by raytracer reflexion --- src/graphics/rtts.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/graphics/rtts.cpp b/src/graphics/rtts.cpp index f6cd2eb8b..a6d43a1f5 100644 --- a/src/graphics/rtts.cpp +++ b/src/graphics/rtts.cpp @@ -300,6 +300,11 @@ RTT::RTT(unsigned int width, unsigned int height, float rtt_scale, getFBO(FBO_HALF1_R).bind(); glClearColor(1., 1., 1., 1.); glClear(GL_COLOR_BUFFER_BIT); + // Raytracer reflexion use previous frame color frame buffer, so we clear it before to avoid + // artifacts in the begining of race + getFBO(FBO_COLORS).bind(); + glClearColor(1., 1., 1., 1.); + glClear(GL_COLOR_BUFFER_BIT); getFBO(FBO_HALF1).bind(); glClearColor(0., 0., 0., 0.); glClear(GL_COLOR_BUFFER_BIT);