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: Shadow cube map: Comparing the depth value

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2011
    Posts
    23

    Question Shadow cube map: Comparing the depth value

    Hello,

    I have a scene rendered into the six sides of a depth cube map from an omni light position using a 90°FOV.

    So far so good.

    Now in the fragment shader I somehow need to compare
    A) the distance between fragment position and light position (direction vector length) with
    B) the distance/depth stored in the depth cube map

    Problem is, the distance B in the cube map cannot be directly
    compared with the "real world" distance A, right?

    How can I get comparable distance values?

    I know how to lookup B but not how to transform the returned
    deoth value into something I can compare with A.

    Help is really appreciated!
    ++i--;

  2. #2
    Junior Member Newbie
    Join Date
    Nov 2011
    Posts
    23
    Probably I just found the answer here:
    http://stackoverflow.com/questions/1...-depth-cubemap

    Can somebody confirm this is how it is done usually?
    ++i--;

  3. #3
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,224
    See this post:

    * Re: GLSL - cube shadows - projecting (deadc0de)

    for some working code showing how.

Posting Permissions

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