]> git.tdb.fi Git - libs/gl.git/commitdiff
Use the same Renderer to render all faces of EnvironmentMap
authorMikko Rasa <tdb@tdb.fi>
Sat, 1 Nov 2014 00:25:49 +0000 (02:25 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 1 Nov 2014 00:25:49 +0000 (02:25 +0200)
source/environmentmap.cpp

index ae98719f16c623f81cc0045bcd4d040f82884129..ec406d157681baec5689ef07538f44f6e6f2dd82 100644 (file)
@@ -39,6 +39,7 @@ void EnvironmentMap::setup_frame() const
        renderable.setup_frame();
        environment.setup_frame();
 
+       Renderer env_renderer(0);
        const Matrix *matrix = renderable.get_matrix();
        Vector3 position = (*matrix)*Vector3();
        camera.set_position(position);
@@ -49,7 +50,7 @@ void EnvironmentMap::setup_frame() const
                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));
-               Renderer env_renderer(&camera);
+               env_renderer.begin(&camera);
                env_renderer.exclude(renderable);
                env_renderer.exclude(*this);
                env_renderer.render(environment);