Shader “CTD/SimpleDiffuse”
{
Properties
(
_ColorTint(“Color Tint”, Color) = (1,1,1,1)
}
SubShader
(
Tags ( " RenderType"-"Opaque" )
CGRPROGRAM
#Pragma surface surf lambert
struct input
{
float color : COLOR;
};
void surf (Input IN, input SurfaceOutput o)
{
o.Aidedo - IN.color;
}
ENDCG
)
Fallback "Diffuse"
)
This poor little shader, there’s an error on almost every line. () and {} Scopes are all broken. The’s also alot of typos. #Pragma needs to be #pragma, lambert to Lambert, etc. You can avoid these by creating a new shader in Unity. Assets->Create->Shader. All that gets generated for you.
After that, all that was needed was to create a _Color property and multiply it with MainTex.
Shader "CTD/SimpleDiffuse" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Color("Color Tint", Color) = (1,1,1,1)
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
fixed4 _Color;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}