Fix artifacts in the begining of race by raytracer reflexion

This commit is contained in:
Benau 2019-06-30 15:42:22 +08:00
parent 8fa3c79be7
commit 1aca4a9ff5

View File

@ -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);