]> git.tdb.fi Git - libs/gl.git/blobdiff - source/environmentmap.cpp
Add a function to clear all FBO component buffers
[libs/gl.git] / source / environmentmap.cpp
index 9c4df092481789d270669450b18f21b6ff71f1e4..bf2a63597cd512244953eba4a7d6ed5dc3248548 100644 (file)
@@ -17,7 +17,7 @@ EnvironmentMap::EnvironmentMap(unsigned s, Renderable &r, Renderable &e):
        update_interval(1),
        update_delay(0)
 {
-       env_tex.storage(RGB, size);
+       env_tex.storage(RGB, size, 1);
        env_tex.set_wrap(CLAMP_TO_EDGE);
        env_tex.set_min_filter(LINEAR);
        depth_buf.storage(DEPTH_COMPONENT, size, size);
@@ -82,7 +82,7 @@ void EnvironmentMap::setup_frame(Renderer &renderer)
        {
                TextureCubeFace face = TextureCube::enumerate_faces(i);
                fbo[i].bind();
-               fbo[i].clear(COLOR_BUFFER_BIT|DEPTH_BUFFER_BIT);
+               fbo[i].clear();
                camera.set_look_direction(env_tex.get_face_direction(face));
                camera.set_up_direction(env_tex.get_t_direction(face));
                renderer.set_camera(camera);