To all the shader magicians out there:
In my mobile game I am using vertex coloring to reduce draw calls. I don’t need specular color, but I would need shadows. This is the shader I wrote:
shader “Custom/SolidColorShader”
{
SubShader {
Tags { “RenderType” = “Opaque” }
CGPROGRAM
#pragma surface surf BlinnPhong vertex:vert
struct Input {
fixed3 vertColors;
};
void vert(inout appdata_full v, out Input o) {
o.vertColors = v.color.rgb;
}
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = IN.vertColors.rgb;
o.Specular = 0;
}
ENDCG
}
Fallback “Diffuse”
}
I am quite new to the topic of shaders. Is there a way to improve performance on this one?