Stardog

Cape two-sided shader Unity 5

Mar 21st, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Shader "Transparent/Cutout/Bumped Diffuse Backwards" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  5. _BumpMap ("Normalmap", 2D) = "bump" {}
  6. _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
  7. }
  8.  
  9. SubShader {
  10. Tags {"IgnoreProjector"="True" "RenderType"="TransparentCutout"}
  11. LOD 300
  12. Cull Front
  13.  
  14. CGPROGRAM
  15. #pragma surface surf Lambert alphatest:_Cutoff
  16.  
  17. sampler2D _MainTex;
  18. sampler2D _BumpMap;
  19. float4 _Color;
  20.  
  21. struct Input {
  22. float2 uv_MainTex;
  23. float2 uv_BumpMap;
  24. };
  25.  
  26. void surf (Input IN, inout SurfaceOutput o) {
  27. half4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
  28. o.Albedo = c.rgb;
  29. o.Alpha = c.a;
  30. o.Normal = -UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
  31. }
  32. ENDCG
  33. }
  34.  
  35. FallBack "Transparent/Cutout/Diffuse"
  36. }
Add Comment
Please, Sign In to add comment