- Home /
Question by
Sunshine95 · Aug 30, 2017 at 05:28 PM ·
renderingmaterialimage effects
Edge detection is not affect to self made shader
Standart Unity 5 Edge detection image effect is not affect to my self made shader as i want. But, standart legacy cutout shader is working good.
What can i do?
This is my shader general code:
half4 LightingCelShadingForward(SurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
{
half NdotT = smoothstep(-1,1,dot(s.Normal, lightDir));
half NdotL = dot(s.Normal, viewDir)/2;
NdotL = lerp(NdotL,NdotT,_True);
float light = atten;
light = lerp(round(light*100/70)/100*70,atten,_Lerp);
if(atten>_Light){if(light<_Light){light = _Light;}}
half4 c;
float t = _Dark;
if(NdotL>=_Pure)t=0.5;
t = lerp(t,NdotL,_Lerp);
c.rgb = (s.Albedo * _LightColor0.rgb) * t*2 * light;
c.a = s.Alpha;
return c;
}
sampler2D uv_MainTex;
sampler2D uv_NormalMap;
fixed4 _Color;
void surf (Input IN, inout SurfaceOutput o)
{
float4 tex = tex2D(_MainTex, IN.uv_MainTex) * _Color;
clip (tex.a - 0.5);
o.Albedo = tex.rgb;
o.Normal = UnpackNormal(tex2D(_NormalMap, IN.uv_NormalMap));
IN.uv_NormalMap),_Power);
}
86.png
(247.6 kB)
Comment