PDA

View Full Version : reflections



nexusone
07-04-2000, 03:21 AM
I have worked with POVRay and I am wondering is there a reflectivity setting for an objects texture?
Is there a good example of making an object reflective?

http://www.opengl.org/discussion_boards/ubb/smile.gif

MikeC
07-04-2000, 04:23 AM
Do you want actual reflections, or just a general impression of shininess?

General shininess is controlled with a glMaterial parameter, rather than through the texture. You may want to render specular highlights as a separate pass or investigate the "separate specular colour" extension for best results. You can find a demo of the multipass technique with source at http://perso.libertysurf.fr/gritche/OpenGL/Technique/reality.sgi.com/jamesb/multi.html

If you mean real reflections, it's a lot hairier. If you're just starting out with OpenGL, I'd postpone attempting this until you're comfortable with the basics. But yes, there's a whole bunch of hardware-accelerated environment mapping techniques appearing at the moment, which can do exactly this.

phlake
07-05-2000, 09:54 AM
in a relatively static environment, you can give a nice impression of shininess with environment mapping as well. the red book has a brief but useful description of this technique in chapter 9, as well as a color plate to assist your understanding.
basically, you provide a texture of the environment as reflected from a sphere, and when the environment mapped object is displayed, texels are chosen based on a combination of the camera angle and the surface normal at that point. it does this by choosing a point with a matching normal in the texture. it's kinda cheesey, but works fine in limited situations. (the cars in SanFransicso Rush used environment mapping, for example, and it looks like Neverwinter Nights is using it extensively in combination with multitexturing to vary the reflectivity on a per-texel basis.)