- Home /
Depth mask shader and Unity shadows
I'm using the technique from the Unify wiki to mask depth, by having two cameras, one clearing depth only, and then using the SetRenderQueue and a Plane with a hole cut in the middle of it, to mask the view for the other camera to create a minimap (and various other uses)
The only trouble is, because Unity shadows seem to rely on objects being specifically in the geometry queue to work, the SetRenderQueue trick here breaks shadows. Is there any way around this, i.e. some way of masking without messing with RenderQueue, or some way of forcing shadows to work on a different RenderQueue (or indeed any sensible way of using Depth Mask and shadows simultaneously- the more general question)?
I can achieve similar effects using RenderTextures but am keen to get this working without as it will allow me to create a generic solution that will work equally well for Indie and Pro users, and I'm so close to getting it all working!
Thanks in advance! Mike