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

How can i use a variable as stencil reference value?

Discussion in 'Shaders' started by tobloef, Mar 19, 2018.

  1. tobloef

    tobloef

    Joined:
    Apr 8, 2015
    Posts:
    13
    Hello.

    I have a stencil shader that I want to use in a few different scenarios, where I need a few different ref values. Is there any way I can specify the ref value on a per-object basis, like with properties? Or do I need different shaders for different stencil reference values?

    Thanks :)