Hi all,
I wrote a very simple shader for prototyping a game. The goal is to swap the color of a car on the fly without editing texture every time.
It is achieved by a color exclude map that told shader when to use the alternate color.
You can notice that the model starts to lose detail when the camera moves away, which did not happen when there is no exclude map applied.
Here is my code:
void surf (Input IN, inout SurfaceOutputStandard o)
{
// Albedo comes from a texture tinted by color
fixed4 exclude = tex2D(_ExcludeTex, IN.uv_MainTex);
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
if(exclude.r>0){
c.rgb = _AlterColor.rgb;
}
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = c.a;
}
Can someone help me out, please?