Search Unity

See Through Objects Shader

Discussion in 'General Graphics' started by tiggaxxx, Dec 17, 2021.

  1. tiggaxxx

    tiggaxxx

    Joined:
    Jan 13, 2020
    Posts:
    30


    I made a See Through shader based on the URP Lit Shader. This shader is applied on the skin material. The objective is to avoid showing skin through clothes in certain situations.

    I added a stencil buffer to the Lit Shader.

    Code (CSharp):
    1. Stencil {
    2.        Ref 2
    3.        Comp NotEqual
    4.        Pass Keep
    5.        Fail Keep
    6.        ZFail Keep
    7. }
    And the cloth works as a mask through a render object.



    Any idea how to avoid the problem you see on the 1st picture?