X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fenvironmentmap.cpp;h=82e1f1d9ad86774d2c716306aebc5b03b012c369;hb=5ba1446b314ddc914693cb9cbb9a7b54a4d30a45;hp=09a9b468277f7fad0c8f030e69ff820157aa70a4;hpb=131bec9b254f5ba50dcaf7e6192baab9e9ccba6f;p=libs%2Fgl.git diff --git a/source/environmentmap.cpp b/source/environmentmap.cpp index 09a9b468..82e1f1d9 100644 --- a/source/environmentmap.cpp +++ b/source/environmentmap.cpp @@ -20,6 +20,7 @@ EnvironmentMap::EnvironmentMap(unsigned s, Renderable &r, Renderable &e): { fbo[i].attach(COLOR_ATTACHMENT0, env_tex, TextureCube::enumerate_faces(i), 0); fbo[i].attach(DEPTH_ATTACHMENT, depth_buf); + fbo[i].require_complete(); } // XXX Make the depth range configurable @@ -45,7 +46,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 +54,7 @@ void EnvironmentMap::setup_frame() const env_renderer.exclude(renderable); env_renderer.render(environment); } + Framebuffer::unbind(); } void EnvironmentMap::finish_frame() const