View Full Version : glass environment map

11-28-2002, 02:49 PM
I am dong a scene with some environment mapped objects but they all look like metal
if I apply the maps directly to the objects. How do I make them look more like glass?
Probably I need to generate a second environment map indexed by something else other than the reflection vector? How do I combine the two maps? (Do I blend them?)

11-28-2002, 06:51 PM
Glass doesn't reflect as much as metal, because it lets most of the light through, so you should just dim the output of your environment map.

Oh, and also make sure that your glass is also transparent. Real glass has an index of refraction that's greater than 1. Making the transparency do the right thing there is going to be a little bit trickier than just applying an environment map, though :-)

11-29-2002, 03:47 PM
With glass the idea is to add the refraction and reflection maps together. For best results blend them as a function of V.N. Something like f(V.N) * refraction + (1.0-f(V.N)) * reflection. Where the function is something like a lookup of the fresnel factor (1d texture) but any old effect actually looks pretty good. For added effect you can do the refraction of red green and blue components separately to simulate the chromatic abberation of the reflection. NVIDIA has some great demos that do all of the above and allow you to change the refractive index of the material & toggle the various terms on and off. Your refraction direction is going to be very approximate at best, but you can't have everything.