Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. // Licensed under CC0, No Rights Reserved
  2. Shader "Custom/TransparentCutoutDoubleSidedDiffuseShader" {
  3. Properties {
  4. _Color ("Color", Color) = (1, 1, 1, 1)
  5. _Alpha ("Alpha Map", 2D) = "white" {}
  6. _Normal ("Normal Map", 2D) = "bump" {}
  7. _Cutout ("Cutout", Range(0, 1)) = 0.5
  8. }
  9. SubShader {
  10. Tags {
  11. "Queue"="AlphaTest"
  12. "IgnoreProjector"="True"
  13. "RenderType"="TransparentCutout"
  14. }
  15. LOD 200
  16. Cull Off
  17. Lighting On
  18. Blend SrcAlpha OneMinusSrcAlpha
  19. CGPROGRAM
  20. #pragma surface surf Lambert alphatest:_Cutout addshadow
  21. #pragma target 3.0
  22. struct Input {
  23. float2 uv_Normal;
  24. float2 uv_Alpha;
  25. };
  26. fixed4 _Color;
  27. sampler2D _Normal;
  28. sampler2D _Alpha;
  29. UNITY_INSTANCING_BUFFER_START(Props)
  30. UNITY_INSTANCING_BUFFER_END(Props)
  31. void surf (Input IN, inout SurfaceOutput o) {
  32. fixed4 norm = tex2D (_Normal, IN.uv_Normal);
  33. fixed4 alpha = tex2D (_Alpha, IN.uv_Alpha);
  34. o.Albedo = _Color;
  35. o.Alpha = alpha.a;
  36. o.Normal = UnpackNormal(norm);
  37. }
  38. ENDCG
  39. }
  40. FallBack "Transparent/Cutout/Diffuse"
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement