39 lines
897 B
Plaintext
39 lines
897 B
Plaintext
// See "Mobile/Diffuse + Color " for why this had to be rewritten from the property block.
|
|
Shader "Mobile/Diffuse + Emission " {
|
|
Properties {
|
|
_MainTex ("Base (RGB)", 2D) = "white" {}
|
|
_Color ("Color", Vector) = (1,1,1,1)
|
|
_EmissionColor ("Emission Color", Vector) = (0,0,0,1)
|
|
_EmissionMap ("Emission", 2D) = "white" {}
|
|
}
|
|
|
|
SubShader {
|
|
Tags { "RenderType"="Opaque" }
|
|
LOD 150
|
|
|
|
CGPROGRAM
|
|
#pragma surface surf Lambert noforwardadd
|
|
#pragma target 3.0
|
|
|
|
sampler2D _MainTex;
|
|
sampler2D _EmissionMap;
|
|
fixed4 _Color;
|
|
fixed4 _EmissionColor;
|
|
|
|
struct Input {
|
|
float2 uv_MainTex;
|
|
float2 uv_EmissionMap;
|
|
};
|
|
|
|
void surf (Input IN, inout SurfaceOutput o) {
|
|
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
|
|
o.Albedo = c.rgb;
|
|
o.Emission = tex2D(_EmissionMap, IN.uv_EmissionMap).rgb * _EmissionColor.rgb;
|
|
o.Alpha = c.a;
|
|
}
|
|
ENDCG
|
|
}
|
|
|
|
Fallback "Mobile/VertexLit"
|
|
}
|