PDA

View Full Version : Reflections



Edgar
03-24-2000, 02:53 PM
I'm using sphere reflections by using glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP) and
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP). For most objects in the scene reflection is generated correctly, but if I have an object which is attach to camera, the reflection never changes. It stays the same regardless if I move around. I load inverse camera matrix at the beginning of the frame and then use glPushMatrix() and glMultMatrixf(...) for each object before I draw it. Any ideas?

FATBUDDHA
03-29-2000, 10:46 AM
You'll kick yourself with this one....

When you generate the environment map, you're producing a texture map that describes the surrounding environment at that moment in time.

When you then move an object in the scene (i.e. an object attached to the camera), the environment mapped object is still using the texture map that was created at the beginnining of the programme, so any objects that have moved since the beginnining of the programme, will appear to have not moved.

What you'd need to do to stop this problem, is rebuild the environment map every frame (which would take some time).

If your interested in a faster solution to this problem, just leave me a message on this thread, and I'll explain it.

Hope this helps http://www.opengl.org/discussion_boards/ubb/smile.gif

redinger
05-10-2000, 04:56 AM
Hey FatBuddha, I'd be interested in hearing about your faster solution! Does it still involve environment mapping?

Christopher

[QUOTE]Originally posted by FATBUDDHA:
If your interested in a faster solution to this problem, just leave me a message on this thread, and I'll explain it.