46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
// See "Mobile/Diffuse + Color " for why this had to be rewritten from the property block.
|
|
// _Gloss drives the specular mask, _Shininess the highlight tightness -- both are
|
|
// [PowerSlider(5.0)] in the original, i.e. they read as perceptually linear 0..1.
|
|
Shader "Mobile/Diffuse + Emission + Specular" {
|
|
Properties {
|
|
_MainTex ("Base (RGB)", 2D) = "white" {}
|
|
_Color ("Color", Vector) = (1,1,1,1)
|
|
_EmissionColor ("Emission Color", Vector) = (0,0,0,1)
|
|
[NoScaleOffset] _EmissionMap ("Emission", 2D) = "white" {}
|
|
[PowerSlider(5.0)] _Gloss ("Gloss", Range(0, 1)) = 0.078125
|
|
[PowerSlider(5.0)] _Shininess ("Shininess", Range(0, 1)) = 0.078125
|
|
}
|
|
|
|
SubShader {
|
|
Tags { "RenderType"="Opaque" }
|
|
LOD 250
|
|
|
|
CGPROGRAM
|
|
#pragma surface surf BlinnPhong noforwardadd
|
|
#pragma target 3.0
|
|
|
|
sampler2D _MainTex;
|
|
sampler2D _EmissionMap;
|
|
fixed4 _Color;
|
|
fixed4 _EmissionColor;
|
|
half _Gloss;
|
|
half _Shininess;
|
|
|
|
struct Input {
|
|
float2 uv_MainTex;
|
|
};
|
|
|
|
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_MainTex).rgb * _EmissionColor.rgb;
|
|
o.Gloss = _Gloss;
|
|
o.Specular = _Shininess;
|
|
o.Alpha = c.a;
|
|
}
|
|
ENDCG
|
|
}
|
|
|
|
Fallback "Mobile/VertexLit"
|
|
}
|