Hi everyone!
I have a script that create light effect on the edges of the object, it works great for me but I need this material to work like unlit texture shader, so it should not recieve any light from scene. Here is the code:
Shader "Custom/SunGlow" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = "white" {}
_RimColor ("Rim Color", Color) = (0.26,0.19,0.16,0.0)
_RimPower ("Rim Power", Range(0.5,8.0)) = 3.0
}
SubShader {
Tags { "RenderType" = "Opaque" }
Lighting Off
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float2 uv_MainTex;
float3 viewDir;
};
sampler2D _MainTex;
float4 _RimColor;
float _RimPower;
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
o.Emission = _RimColor.rgb * pow (rim, _RimPower);
}
ENDCG
}
Fallback "VertexLit"
}