Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glass environment map

  1. #1
    Intern Contributor
    Join Date
    Sep 2002
    Posts
    61

    glass environment map

    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?)

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    Re: glass environment map

    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 :-)
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  3. #3
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,962

    Re: glass environment map

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •