Archived

This topic is now archived and is closed to further replies.

colinisinhere

[fake]reflective surfaces

Recommended Posts

You know how in Half-life... how the revolver apears to reflect, and in Wolfestein ET how the thomson apears to shine? How exactly is this done? Im sure its just multitextureing with the UV map for the relection map altered from where the Camera pos is... am i right? How? thanks

Share this post


Link to post
Share on other sites
AFAIK, Half-Life just did it with multitexuring + sphere environment mapping. You'll notice that the revolver doesn't really reflect the environment, just a blurry general environment (i.e. the environment map is a single constant texture). The rest of the effect owes to the vertex-based environmental lighting Half-Life performed on whatever was in the player's hands.

This could all be completely wrong, but based on what I've seen, it seems reasonable.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links


[edited by - zealouselixir on October 6, 2003 7:00:04 PM]

Share this post


Link to post
Share on other sites
Oh. I figured you knew how sphere mapping works. To do it in OpenGL, set up a fisheye texture in one of your units and change the following states.

glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);

glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);

NeHe''s lesson #23 covers it in more detail, implementation-wise. For more theory, check this: Mark Kilgard''s GDC presentation on realtime environmental sphere mapping

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

Share this post


Link to post
Share on other sites