- Home /
Problem with lighting in CG Shader
Hi,
i wrote a simple shader that compose a texture with a color. Now i just want to turn off the lighting but it doesn't work.. Here's my shader:
Shader "Custom/MyDecalColor" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 250
Lighting Off
CGPROGRAM
#pragma surface surf Lambert
#include "UnityCG.cginc"
sampler2D _MainTex;
fixed4 _Color;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
half4 main = tex2D(_MainTex, IN.uv_MainTex);
c.rgb = lerp (_Color, main.rgb, main.a);
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "Diffuse"
}
Can somebody help me?
Comment
Why would you use a surface shader if you don't want lighting?