Guest User

Untitled

a guest
Nov 17th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Shader "Custom/My Shader3" {
  2. Properties {
  3. _MainTex ("Base (RGB)", 2D) = "white" {}
  4. _BumpMap ("Bump map", 2D) = "bump" {} //Указываем что это обычная текстура
  5. }
  6. SubShader {
  7. Tags { "RenderType"="Opaque" }
  8. LOD 200
  9.  
  10. CGPROGRAM
  11. #pragma surface surf Lambert
  12.  
  13. sampler2D _MainTex;
  14. sampler2D _BumpMap;
  15.  
  16. struct Input {
  17. float2 uv_MainTex;
  18. float2 uv_BumpMap;
  19. };
  20.  
  21. void surf (Input IN, inout SurfaceOutput o) {
  22. half4 c = tex2D (_MainTex, IN.uv_MainTex);
  23. o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); //Магия
  24. o.Albedo = c.rgb;
  25. o.Alpha = c.a;
  26. }
  27. ENDCG
  28. }
  29. FallBack "Diffuse"
  30. }
Add Comment
Please, Sign In to add comment