Shader "Custom/Silhouette" {
Properties {
_MainTex ("Main Tex", 2D) = "white" {}
_DotProduct("Normal intensity",Range(-1,1))=0.25
}
SubShader {
Tags { "Queue"="Transparent" "IngnoreProjector"="True" "RenderType"="Transparent" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Lambert alpha:fade nolighting
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float3 worldNormal;
float3 viewDir;
};
float _DotProduct;
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex,IN.uv_MainTex);
o.Albedo = c.rgb;
float border = 1-(abs(dot(IN.viewDir,IN.worldNormal)));
float alpha = (border*(1-_DotProduct)+_DotProduct);
o.Alpha = c.a*alpha;
}
ENDCG
}
FallBack "Diffuse"
}
中间透明边缘泛光
最新推荐文章于 2022-07-29 20:37:22 发布