Right, so, uh…
Shader "Custom/Redline" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Ramp ("Ramp Texture", 2D) = "white" {}
_SpecRamp ("Specular Ramp", 2D) = "white" {}
_Outline ("Outline", Range(0,1)) = 0.4
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_Shininess ("Shininess", Range(0,10)) = 0.1
}
SubShader {
Tags { "RenderType"="Opaque" }
UsePass "Toon/Basic/BASE"
Pass {
Name "LIGHTING"
Tags { "LightMode" = "Always" }
Cull Off
ZWrite On
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma lighting LightingToon
sampler2D _MainTex;
sampler2D _Ramp;
sampler2D _SpecRamp;
float _Shininess;
half4 LightingToon(SurfaceOutput s, half3 lightDir, half atten ) {
half4 c;
half NdotL = dot(s.Normal, lightDir);
NdotL = tex2D(_Ramp, float2(NdotL, 0.5));
half NdotLSpec = dot(s.Normal, lightDir);
NdotLSpec = tex2D(_SpecRamp, float2(NdotLSpec, 0.5));
c.rgb = (s.Albedo * _LightColor0.rgb * NdotL * (atten * 2)) + (NdotLSpec * _Shininess);
c.a = s.Alpha;
return c;
}
ENDCG
}
UsePass "Toon/Basic Outline/OUTLINE"
}
FallBack "Diffuse"
}
This is meant to be a toon shader with two ramps, one for basic lighting and one for specularity. It won’t work – the entire textured surface consists of black and in fact, getting the entire thing down to this:
Shader "Custom/Redline" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Ramp ("Ramp Texture", 2D) = "white" {}
_SpecRamp ("Specular Ramp", 2D) = "white" {}
_Outline ("Outline", Range(0,1)) = 0.4
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_Shininess ("Shininess", Range(0,10)) = 0.1
}
SubShader {
Tags { "RenderType"="Opaque" }
UsePass "Toon/Basic/BASE"
UsePass "Toon/Basic Outline/OUTLINE"
}
FallBack "Diffuse"
}
that is, a straight copy of the standard Lighted Outline shader, throws the exact same result. Is something obvious flying over my head again?