VD-BumpedSpec.shader 1.0 KB

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