VD-Bumped.shader 870 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Shader "VD Vertex Color/Bumped Diffuse" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB)", 2D) = "white" {}
  5. _BumpMap ("Normalmap", 2D) = "bump" {}
  6. }
  7. SubShader {
  8. Tags { "RenderType"="Opaque" }
  9. LOD 300
  10. CGPROGRAM
  11. #pragma surface surf Lambert vertex:vert
  12. sampler2D _MainTex;
  13. sampler2D _BumpMap;
  14. half4 _Color;
  15. struct Input {
  16. half2 uv_MainTex;
  17. half4 color;
  18. half2 uv_BumpMap;
  19. };
  20. void vert (inout appdata_full v, out Input o) {
  21. UNITY_INITIALIZE_OUTPUT(Input,o);
  22. o.color = v.color * _Color;
  23. }
  24. void surf (Input IN, inout SurfaceOutput o) {
  25. half4 t = tex2D(_MainTex, IN.uv_MainTex);
  26. o.Albedo = t.rgb * IN.color.rgb;
  27. o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
  28. o.Alpha = t.a;
  29. }
  30. ENDCG
  31. }
  32. Fallback "VD Vertex Color/Diffuse"
  33. }