Advertisement
dnnkeeper

Transparent Bumped Spec Diffuse Colored Shadow

Jan 20th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 KB | None | 0 0
  1. //
  2. // Author:
  3. //   Based on the Unity3D built-in shaders
  4. //   Andreas Suter (andy@edelweissinteractive.com)
  5. //
  6. // Copyright (C) 2013 Edelweiss Interactive (http://www.edelweissinteractive.com)
  7. //
  8.  
  9. Shader "Decal/Colored/Shadow/Transparent Bumped Spec Diffuse Colored Shadow" {
  10.     Properties {
  11.         _Color ("Main Color", Color) = (1,1,1,1)
  12.         _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  13.         _BumpMap ("Normalmap", 2D) = "bump" {}
  14.         _SpecColor("SpecColor", Color) = (1,1,1,1)
  15.         _Specular("Specular", Range(0.0, 1.0)) = 1.0
  16.         _Gloss("Gloss", Range(0.0, 1.0)) = 1.0
  17.     }
  18.  
  19.     SubShader {
  20.         Tags {
  21.             "Queue" = "AlphaTest"
  22.             "IgnoreProjector" = "True"
  23.             "RenderType" = "Transparent"
  24.         }
  25.         Offset -1, -1
  26.  
  27.         CGPROGRAM
  28.         #pragma exclude_renderers flash
  29.         #pragma target 3.0
  30.         #pragma surface surf BlinnPhong fullforwardshadows dualforward decal:blend exclude_path:prepass
  31.  
  32.         sampler2D _MainTex;
  33.         sampler2D _BumpMap;
  34.         fixed4 _Color;
  35.         float _Specular, _Gloss;
  36.  
  37.         struct Input {
  38.             float2 uv_MainTex;
  39.             float2 uv_BumpMap;
  40.             float4 color: Color;
  41.         };
  42.  
  43.         void surf (Input IN, inout SurfaceOutput o) {
  44.             UNITY_INITIALIZE_OUTPUT (SurfaceOutput, o);
  45.             fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color  * IN.color;
  46.             o.Albedo = c.rgb;
  47.             o.Alpha = c.a;
  48.             o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
  49.             o.Specular = _Specular;
  50.             o.Gloss = _Gloss;
  51.         }
  52.         ENDCG
  53.     }
  54.  
  55.     FallBack "Decal/Transparent Diffuse"
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement