What i see is NOT what i ship.

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 :slight_smile: )

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 :cry:

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

61037--2234--$trainingrating_lightblue_on_111.png

File a bug report with a project that shows the issue.

Hmm can’t seem to reproduce the problem in a new slimmed down project.

I will look a little around for the problem before submiting the entire project, which unfortunately is the only place i have the problem atm.

Regards,
Marc

It seems not to be the shader. If i delay initialization of the objects using the shader by 10s for instance. They apear to be rendered correct on my mac however they are still not visible on the windows machine. So this apears to be transparent sorting problem yet again.

Is something in the engine related to graphics initialized in parrallel to when the Awake and Start functions are run, so it might not be ready at the time of Awake or Start?

Regards,
Marc

No, that should not happen.