Advertisement
Guest User

Untitled

a guest
Nov 17th, 2016
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Shader "Custom/My Shader"
  2. {
  3. Properties
  4. {
  5. _Color ("Main Color", Color) = (1,1,1,1)
  6. _Glossiness ("Smoothness", Range(0,1)) = 0.5
  7. _Metallic ("Metallic", Range(0,1)) = 0
  8. _MainTex ("Texture (RGB)", 2D) = "surface" {}
  9. _BumpMap ("Normal map", 2D) = "bump" {}
  10. _Scale ("Texture Scale", Float) = 0.1
  11. }
  12. SubShader
  13. {
  14. Tags { "RenderType"="Opaque" }
  15. LOD 200
  16. CGPROGRAM
  17. #pragma surface surf Lambert
  18. sampler2D _MainTex;
  19. sampler2D _BumpMap;
  20. struct Input
  21. {
  22. float3 worldNormal;
  23. float3 worldPos;
  24. float2 uv_MainTex;
  25. float2 uv_BumpMap;
  26. };
  27. float4 _Color;
  28. float _Scale;
  29. void surf (Input IN, inout SurfaceOutput o)
  30. {
  31. float2 UV;
  32. fixed4 c;
  33. if(abs(IN.worldNormal.z)>0.5)
  34. {
  35. UV = IN.worldPos.xy;
  36. c = tex2D(_MainTex, UV* _Scale);
  37. }
  38. o.Albedo = c.rgb * _Color;
  39. }
  40. ENDCG
  41. }
  42. FallBack "Diffuse"
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement