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);
camera.set_field_of_view(Geometry::Angle<float>::right());
camera.set_aspect_ratio(1);
camera.set_depth_clip(0.1, 100);
-
}
void EnvironmentMap::set_depth_clip(float n, float f)
{
TextureCubeFace face = TextureCube::enumerate_faces(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));
+ fbo[i].clear();
+ camera.set_look_direction(TextureCube::get_face_direction(face));
+ camera.set_up_direction(TextureCube::get_t_direction(face));
renderer.set_camera(camera);
renderer.render(environment);
}