- Home /
Always on top mask shader?
I'm pretty new to shaders but is it possible to make a mask shader that always is on top, making everything in it's path and behind it invisible? I have been able to make a shader that makes a solid color shader always on top, but not a mask shader.
please tell me how you made a texture to always be on top because i have multiple objects like rocks but if i want snow i want to always show the snow texture on top...
Answer by Bunny83 · Jun 25, 2011 at 01:33 AM
Just make sure that you turned off all color channels:
ColorMask 0
and that you still write to the z buffer:
ZWrite On
Your shader should be drawn before everything that should be "masked" of course ;)
Answer by hollym16 · Aug 16, 2013 at 03:20 PM
Have you tried the DepthMask shader?
http://wiki.unity3d.com/index.php?title=DepthMask
It masks everything that is behind it
Your answer
Follow this Question
Related Questions
How to render projector in front of walls but behind player? 1 Answer
Shader issues when trying to fade between two tiles using a mask 1 Answer
How to make effect between scenes with UI Mask or Shader 0 Answers
Using a mask shader for creating pop/explosion effect? 1 Answer
Why is my picture distorted? 0 Answers