Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to access shadow map depth values?

Discussion in 'Shaders' started by Overv, Mar 4, 2015.

  1. Overv

    Overv

    Joined:
    Mar 4, 2015
    Posts:
    1
    Hi,

    I would like to use the depth values from a shadow map to create a blanket mesh over the scene for various effects. I've found that I can access the attenuation (0 or 1) using LIGHT_ATTENUATION, but I need the actual depth stored in the texture. How do I access that?

    Does the method of access differ for different types of lights? If so, I'm primarily interested in directional lights.
     
    thijser likes this.
  2. thijser

    thijser

    Joined:
    Feb 26, 2013
    Posts:
    19
    I'm wondering about this as well.