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 2 of 2

Thread: "Stretching" shadow z coordinate to make the most of non-linear depth buffer?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Mar 2009
    Location
    California
    Posts
    188

    "Stretching" shadow z coordinate to make the most of non-linear depth buffer?

    Non-linear depth textures provide no advantage to shadowmaps. They provide greater precision closer to the light source, but lower precision far away from the source.

    To get around this, I am thinking about bringing the z coordinate of my shadow vertices closer to the camera. The goal is to get an even distribution of precision across the entire shadowmap, without manually writing to gl_FragDepth, so we can retain early Z discard.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,183
    For cubemap shadowmaps I just don't bother with depth; instead I store a linear distance using a color buffer only (and using a minimum blend operation to simulate "depth") which works fine and makes the biasing easier when it comes to comparison time.

Posting Permissions

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