- Home /
Question by
consumedman · Aug 15, 2018 at 08:49 PM ·
shadershadersmasking
Can you mask a shader effect with a stencil
What i want to achieve is a black and white shader that is only applied when under a stencil, or any other solution that has the same effect.
Here is a demo of what I mean:
I hacked this up by using two objects, both have a stencil mask, one is only rendered under the mask and the other is only rendered when not under it. I could also get it working with two materials on the same object but both of these would mean that i have to have every texture in 2 copies, which defeats the purpose of having a black and white shader.
Is this even possible or should i abandon this idea and find another approach?
demo.png
(126.0 kB)
Comment