VD-Glossy.shader 910 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Shader "VD Vertex Color/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. }
  8. SubShader {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 300
  11. CGPROGRAM
  12. #pragma surface surf BlinnPhong vertex:vert addshadow
  13. sampler2D _MainTex;
  14. half4 _Color;
  15. half _Shininess;
  16. struct Input {
  17. half2 uv_MainTex;
  18. half4 color;
  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.Gloss = t.a;
  28. o.Specular = _Shininess;
  29. o.Alpha = t.a;
  30. }
  31. ENDCG
  32. }
  33. Fallback "Vertexlit"
  34. }