Hi everyone,
So lately I’ve been doing some researches and tried to develop a working FPS view without clipping that still receives shadows from the world.
As a result I don’t use the culling mask/multi camera technique. I ended up wrapping together something. I have a completely transparent shader that writes to the Z buffer, and a second shader that uses the Z buffer normally (LEqual) to actually draw the weapon. They’re both bound to 2 different materials on the same submesh (despite Unity’s advice the performance doesn’t seem to suffer, probably because the first shader is really lightweight).
The second shader is a complete copy of the built-in standard shader, except I added to both subshaders the tag “Queue”=“Overlay+2” (Overlay+1 being used by the transparent shader, to make sure the Z buffer is affected last by the transparent shader before drawing the gun). My problem is that it still doesn’t receive shadows. As soon as I remove the Queue tag it works again, it does receive the shadows, but the Z buffer doesn’t affect the drawing of the gun/hand anymore.
Any hint at what could cause that, because I’ve been bumping my head for the last hours, and my lacking skills in shader development is driving me crazy right now ![]()
Thanks in advance guys !