Where is the catch in my shader:
Shader "CustomShaders/Bumped Specular Reflective" {
Properties {
_Shininess ("Shininess", Range (0.03, 1)) = 0.078125
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
_BumpMap ("Normalmap", 2D) = "bump" {}
_SpecMap ("Specular map", 2D) = "black" {}
_ReflMap ("Reflective map", 2D) = "black" {}
_ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
_Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect }
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 250
CGPROGRAM
#pragma surface surf MobileBlinnPhong exclude_path:prepass nolightmap noforwardadd halfasview novertexlights
inline fixed4 LightingMobileBlinnPhong (SurfaceOutput s, fixed3 lightDir, fixed3 halfDir, fixed atten)
{
fixed diff = max (0, dot (s.Normal, lightDir));
fixed nh = max (0, dot (s.Normal, halfDir));
fixed spec = pow (nh, s.Specular*128) * s.Gloss;
fixed4 c;
c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * spec) * (atten*2);
c.a = 0.0;
return c;
}
sampler2D _MainTex;
sampler2D _BumpMap;
sampler2D _SpecMap;
sampler2D _ReflMap;
samplerCUBE _Cube;
half _Shininess;
fixed4 _ReflectColor;
struct Input {
float2 uv_MainTex;
float3 worldRefl;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 tex = tex2D (_MainTex, IN.uv_MainTex);
fixed4 reflTex = tex2D(_ReflMap, IN.uv_MainTex);
fixed4 specTex = tex2D(_SpecMap, IN.uv_MainTex);
o.Albedo = tex.rgb * 0.5;
o.Gloss = specTex.r;
o.Specular = _Shininess * specTex.g;
o.Normal = UnpackNormal (tex2D(_BumpMap, IN.uv_MainTex));
o.Alpha = tex.a;
fixed4 reflcol = texCUBE (_Cube, IN.worldRefl);
reflcol *= reflTex.a;
o.Emission = reflcol.rgb; * _ReflectColor.rgb;
}
ENDCG
}
FallBack "Mobile/VertexLit"
}