I am using Vertex Color shader for coloring my generated mesh.
I have a problem, when I want to reduce alpha of mesh color, e.g. for water, I get strange artifacts on the mesh.
**Here is shot without water having any alpha:**
- http://i.imgur.com/1Bmjpio.png
**Here is shot with water mesh having reduced alpha** - problem is seen here
- http://i.imgur.com/QKBGxGR.png
**Here is one shot under water, no faces / polygons are sideways that could cause the problem**
- http://i.imgur.com/J5poco7.png
**Here is wireframe mode**
- http://i.imgur.com/6zJOrRb.png
The problem is in 2nd picture, water having artifacts with alpha reduced. The color changes depending on Camera Background color, e.g. red-ish in this example.
Shader I use:
Shader "Custom/Vertex Lit - Shadows" {
SubShader{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma surface surf Lambert keepalpha fullforwardshadows
struct Input {
fixed4 color : COLOR;
};
void surf(Input IN, inout SurfaceOutput o) {
o.Albedo = IN.color.rgb;
o.Alpha = IN.color.a;
}
ENDCG
}
Fallback "VertexLit"
}
↧