I created this shader a modified version of the reveal texture shader on the wiki.
Shader "3D Menu/RevealTexture" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Mask ("Mix Mask (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue" = "Overlay"}
Lighting On Cull Off ZTest Always ZWrite Off Fog { Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Material {
Diffuse [_Color]
}
// Apply base texture
SetTexture [_MainTex] {
constantColor [_Color] combine texture * primary DOUBLE, texture * primary
}
// Multiply in the mask
SetTexture [_Mask] {
constantColor [_Color] combine previous, texture * previous
}
}
}
FallBack "VertexLit", 1
}
I use it to create rating stars and by offsetting the mask i can create one, two or 3 stars. Now in the editor this works perfectly! however, when i build a standalone it apears that the stars dont get rendered like in the editor.
I use the same texture on both _MainTex and Mask i have attached the texture to the post. It is basically an all white texture with an alpha channel of 3 white stars and rest is black. (Is not easy to see but is present at the bottom of post )
I thought it might be related to transparency depth sorting problems as the geometry is quite close to the backdrop geometry (They are part of the same fbx file but as two seperate objects.), but as it turns out i think its not the case, cuase if i switch to the transparent diffuse shader the texture is rendered in the build aswell.
I tried modifying the shader by removing these lines:
SetTexture [_Mask] {
constantColor [_Color] combine previous, texture * previous
}
Now the shader is just basically a simple version of the transparent diffuse shader, and if i use this modified shader it renders in the build just like the transparent diffuse shader. Now im just with out the functionality i was after
Why does the shader give the desired effect in the editor, but not in builds ?!?
is this a bug or am i doing something wrong?
PS: my near and far plane on the camera is set to 5 and 20.
Regards,
Marc