- Home /
Can't get the right draw call order.
Hi,
I have 3 meshes. The first one is just writting to stencil, the second is writting to the color buffer and stencil everywhere where the stencil isn't already marked and finally the last one is writting to the color buffer everywhere where the stencil isn't already marked.
Somehow i can't get the final mesh to be renderer at last. It always get renderer before the second one.
Shader lab queue and Z position didn't help.
Any chance that i miss something ?
First shader settings
Tags
{
"RenderType" = "Overlay"
"Queue" = "Overlay"
"IgnoreProjector" = "True"
"DisableBatching" = "True"
}
Pass
{
ColorMask 0
Cull Off
ZWrite Off
ZTest Always
Stencil
{
Ref 1
Comp always
Pass replace
}
}
Second shader settings
Tags
{
"RenderType" = "Overlay"
"Queue" = "Overlay+1"
"IgnoreProjector" = "True"
"DisableBatching" = "True"
}
Pass
{
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
ZWrite Off
ZTest Always
Stencil
{
Ref 1
Comp Less
Pass replace
}
}
Third shader settings
Tags
{
"RenderType" = "Overlay"
"Queue" = "Overlay+100"
"IgnoreProjector" = "True"
"DisableBatching" = "True"
}
Pass
{
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
ZWrite Off
ZTest Always
Stencil
{
Ref 1
Comp notequal
}
}
Comment
Best Answer
Answer by Lumz · Apr 22, 2016 at 05:37 PM
Well after hours i simply removed the material of mesh 3, then recreated it, and everything worked out.
Your answer