Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Normal Masking" {
- Properties {
- _Col1 ("Color 1", Color) = (1,1,1,1)
- _Col2 ("Color 2", Color) = (0,0,0,1)
- }
- SubShader {
- Tags { "RenderType" = "Opaque" }
- CGPROGRAM
- #pragma surface surf Lambert
- struct Input {
- float4 color : COLOR;
- float3 worldNormal;
- };
- float3 _Col1;
- float3 _Col2;
- void surf (Input i, inout SurfaceOutput o) {
- float3 normal = i.worldNormal;
- float normalMask = normal.x + normal.y + normal.z;
- o.Emission = _Col1 * normalMask + _Col2 * (1-normalMask);
- }
- ENDCG
- }
- Fallback "Diffuse"
- }
Advertisement
RAW Paste Data
Copied
Advertisement