#URP Two-pass shader

1 messages · Page 1 of 1 (latest)

inner vapor
#

Hello!

I am attempting to write a two-pass shader for Unity URP.

The two passes in question are:

        Pass
        {
            Stencil
            {
                Ref [_StashHoleStencil]
                Comp Equal
                Pass IncrSat
                Fail Zero
            }
        }
        Pass
        {
            Stencil
            {
                Ref [_UiOverlapStencil]
                Comp Less
                Pass Replace
                Fail Keep
            }
        }

Basically, if the Stencil Buffer is set to a particular value, then it increments it, otherwise it sets it to a desired value. This, however, doesn't seem to work. The second pass is not being executed at all.

How can I solve this? Since I am applying the shader using Render Objects, am I forced to create two RenderObjects features each with different shader, or is there a cleaner way?

rigid peak