Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Writing into shadowmap depth

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

  1. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    62
    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:
    62
    I found solution. Just use output with SV_Depth and SV_Target in shader and enable ZWrite.
     
    joshuacwilde likes this.