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

Writing into shadowmap depth

Discussion in 'General Graphics' started by Chaiker, Aug 10, 2019.

  1. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    63
    Hello. I need write into shadowmap depth buffer of light source (for example spot light) before than shadowmap will be rendered. How I can do this? So I think I can blit one depth texture (custom render texture) with light shadowmap. But I don't know how I can blit depth buffers of these textures.
     
  2. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    63
    I found solution. Just use output with SV_Depth and SV_Target in shader and enable ZWrite.
     
    joshuacwilde likes this.