PDA

View Full Version : Environment mapping with moving camera



08-11-2001, 07:42 AM
Hi,
I've got environment mapping (GL_SPHERE_MAP) working on objects where the camera is fixed at its default position.

When I try to move the camera with gluLookAt, however, the environment map appears as a constant texture (because the texture coordinates are generated relative to the origin in eye coordinates?). Is there an elegant way to resolve this?

Cheers,

Steven Capper

Bob
08-11-2001, 08:42 AM
A spheremap is a texture unique for one single position and direction. As long as the camera stays at this position, everything will be fine, as you said. But as soon as you move the camera, either position or direction (or both http://www.opengl.org/discussion_boards/ubb/smile.gif ), the spheremap needs to be rebuilt. No way around this, sorry.

If you can, use a cube texture instead. These cubetextures usually generates far better reflections, and can very easily be updated when you move the camera.