hi folks!
I am trying to use my own unlit alpha test shader and in the editor he works normally
but in the game not.
Why is this happening? I just need alphatest without shading with light
video of this problem.
[video]http://www.youtube.com/watch?v=vzwmEYuKraA[/video]
this my lit tech
<technique vs="LitSolidAlphaMask" ps="LitSolidAlphaMask" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
<pass name="base" />
<pass name="litbase" psdefines="AMBIENT" />
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />
<pass name="prepass" psdefines="PREPASS" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" />
<pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
<pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
</technique>
this unlit tech
<technique vs="UnlitAlphaMask" ps="UnlitAlphaMask" psdefines="DIFFMAP ALPHAMASK" alphamask="true">
<pass name="base" />
<pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
<pass name="deferred" psdefines="DEFERRED" />
</technique>
the UnlitAlphaMask shader is the same as Unlit but only with this code fix:
// Get material diffuse albedo
#ifdef DIFFMAP
float4 diffColor = cMatDiffColor * tex2D(sDiffMap, iTexCoord);
#ifdef ALPHAMASK
if (diffColor.a < cFactor)
discard;
#endif
#else
float4 diffColor = cMatDiffColor;
#endif
my cFactor is added also to Uniforms.hlsl