void surf(Input IN, inout SurfaceOutputStandard o)
{
// Albedo comes from a texture tinted by color
float4 c = IN.color;
if (IN.color.g > 0)
{
c = tex2D(_Rock, IN.uv_Gas).rgb;
}
if (IN.color.b > 0)
{
c = tex2D(_Snow, IN.uv_Gas).rgb;
}
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = c.a;
}
I am using the preceeding shader function to try to do terrain splatting with vertex colors as the blend factors. However, the textures aren’t showing the terrain is colored green and blue. I am confused as to why the conditions are never true when clearly they should as the color is either green == 1 or blue == 1. Any ideas?