From 44d6110bb0f1bf92c6d749c2fb5345141d681c03 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 12 Sep 2012 20:05:06 +0300 Subject: [PATCH] Don't unbind the fbo until the entire cube map has been rendered --- source/environmentmap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/environmentmap.cpp b/source/environmentmap.cpp index 09a9b468..8cda8cba 100644 --- a/source/environmentmap.cpp +++ b/source/environmentmap.cpp @@ -45,7 +45,7 @@ void EnvironmentMap::setup_frame() const for(unsigned i=0; i<6; ++i) { TextureCubeFace face = TextureCube::enumerate_faces(i); - Bind _bind_fbo(fbo[i]); + fbo[i].bind(); fbo[i].clear(COLOR_BUFFER_BIT|DEPTH_BUFFER_BIT); camera.set_look_direction(env_tex.get_face_direction(face)); camera.set_up_direction(env_tex.get_t_direction(face)); @@ -53,6 +53,7 @@ void EnvironmentMap::setup_frame() const env_renderer.exclude(renderable); env_renderer.render(environment); } + Framebuffer::unbind(); } void EnvironmentMap::finish_frame() const -- 2.45.2