Vertex Lit Transparent Shader problem with Z
Hi! I'm trying to work with a shader but the main problem is that the Z is rendering strange, and I don't know whats causing it / how to fix.
All the cubes share the same material and the vertex are being painted by programming, the code is being written for mobile platform.
In the image you see that when I try to work with alpha, to put some shadow to blend with the color of the terrain, what happens is the terrain being rendered above some items, if I change the camera angle, the images can be saw. Is there a way to fix it?
Thanks in advance,
Shader "Custom/Vertex Colored" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Trasnparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 200
CGPROGRAM
#pragma surface surf Lambert alpha
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float4 color: Color; // Vertex color
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = IN.color.rgb; // vertex RGB
o.Alpha = IN.color.a; // vertex Alpha
}
ENDCG
}
FallBack "Mobile/Diffuse"
}
Your answer
Follow this Question
Related Questions
Unity5 PBR - Single Pass possible? 0 Answers
Very basic shader problem 0 Answers
Tweening 50 circles 0 Answers
Different Display of Plant Object Based on Distance 0 Answers
Storing data from previous shader pass 0 Answers