- Home /
How can I disable masked object shadow with DepthMask shader
Hey there,
I'm using DepthMask shader from Unity wiki as ;
Shader "Masked/Mask" {
SubShader {
Tags {"Queue" = "Geometry+1"}
ZTest LEqual
ZWrite On
ColorMask 0
Pass {}
}
}
Then, I'm setting renderQueue of the object that will be masked with a helper script as ;
void Awake() {
var renderers = GetComponentsInChildren<Renderer>();
foreach (var randr in renderers) {
randr.material.renderQueue = 2002;
}
}
With that setup I'm able to mask gameobjects part of screen. But there is a problem I'm keep getting shadows of those invisible objects here is the screenshot ;
I would like to know if there is a way get rid of shadows of masked objects. I'm using Deferred Lighting mode as Rendering Path.
Comment
Did you solved your problem?
I'm interested on the solution