Advertisement
Guest User

on/off two tone lighting shader for Unity

a guest
Dec 26th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Custom/On Off Lighting"
  2. {
  3.     Properties
  4.     {
  5.         _Color ("Color", Color) = (1,1,1,1)
  6.         _Shadow ("Shadow Color", Color) = (1,1,1,1)
  7.         _ShadowStrength ("Shadow Strength", Range(0,1)) = 0.2
  8.     }
  9.     SubShader {
  10.         Tags { "RenderType" = "Opaque" }
  11.         CGPROGRAM
  12.         #pragma surface surf SimpleLambert
  13.  
  14.         fixed4 _Color;
  15.         fixed4 _Shadow;
  16.         float _ShadowStrength;
  17.  
  18.         half4 LightingSimpleLambert (SurfaceOutput s, half3 lightDir, half atten) {
  19.             fixed4 shadow = lerp(_Color, _Shadow, _ShadowStrength);
  20.             return lerp(shadow, _Color, atten);
  21.         }
  22.  
  23.         struct Input {
  24.             half null;
  25.         };
  26.  
  27.         void surf (Input IN, inout SurfaceOutput o) {
  28.             o.Albedo = 1;
  29.         }
  30.         ENDCG
  31.     }
  32.     Fallback "Diffuse"
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement