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

Light Matte Shader

Discussion in 'High Definition Render Pipeline' started by max_coding13, Feb 14, 2020.

  1. max_coding13

    max_coding13

    Joined:
    Apr 24, 2016
    Posts:
    34
    It's a well worn conversation on how to build a "shadow matte" shader (transparent shader that only shows received shadows), and Unity even has an option on their Unlit shader graph - "shadow matte" - that makes this easy in HDRP.

    But I haven't seen any conversation on how you might go about doing the inverse - a "light matte" shader that shows only received lighting values.

    Has anyone seen this done yet in HDRP? It would be especially amazing if this would be possible with RTX lighting data - but I won't hold my breath.
     
    Last edited: Feb 14, 2020
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, in HDRP you have Light layers / Shadow Layers and Shadow matte. With this combination you should be able to do what you want. Shadow layers would allow to disable shadow but receive the lighting. You can check the Light documentation, it is in advanced settings of a light under shadow section.
    Note: shadow matte is not compatible with raytracing currently.
     
    max_coding13 likes this.
  3. max_coding13

    max_coding13

    Joined:
    Apr 24, 2016
    Posts:
    34
    Thanks @SebLagarde, I was able to get something working based on your advise. I appreciate you pointing me in the right direction!