Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Project/DecalDiffuse"
- {
- Properties
- {
- _Color ("Color", Color) = (1,1,1,1)
- _Emission("Emission", Color) = (0,0,0,0)
- _MainTex ("Diffuse Texture", 2D) = "white" {}
- }
- SubShader
- {
- Tags
- {
- "RenderType" = "Opaque"
- "IgnoreProjector" = "True"
- "Queue" = "Geometry"
- "LightMode" = "Deferred"
- }
- LOD 200
- CGPROGRAM
- #pragma surface surf WrapLambert exclude_path:deferred decal:blend
- half4 LightingWrapLambert (SurfaceOutput s, half3 lightDir, half atten)
- {
- half NdotL = dot (s.Normal, lightDir);
- half diff = NdotL * 0.5 + 0.5;
- half4 c;
- c.rgb = s.Albedo * _LightColor0.rgb * (diff * atten);
- c.a = s.Alpha;
- return c;
- }
- struct Input
- {
- float2 uv_MainTex;
- half4 color : COLOR;
- };
- sampler2D _MainTex;
- fixed4 _Color;
- fixed4 _Emission;
- void surf (Input IN, inout SurfaceOutput o)
- {
- fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
- o.Albedo = c.rgb * IN.color.rgb;
- o.Alpha = c.a * IN.color.a;
- o.Emission = _Emission;
- }
- ENDCG
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement