Hello,
I have a custom made shader (made in Shader Forge) which I would like to use as a part of my UI for rendering some images inside a Scroll View. However, when I try to use this shader for UI rendering, then I get the following warning from Unity:
Material MyMaterialName doesn’t have stencil properties
This warning is quite expected, since this shader previously just was used for rendering meshes ingame, and not for rendering UI, so I haven’t implemented any stencil properties support in the shader. The result is that UI images using this shader are still rendered when they are outside of the visible area of the Scroll View. This is also quite expected ![]()
My questions are:
-
Is there an easy way to get a Shader Forge shader work well with Unity UI? (enabling “Stencil Buffer” under “Blending” doesn’t suffice)
-
If the answer is “no” to question 1, then what would you recommend for Unity UI shaders - make your custom UI shaders without Shader Forge, or something else?
Thank you very much in advance for your help.
Kind regards,
Uffe Flarup
