BaseMapTextured.shader 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // BaseMap shader for use on ground/water regions.
  2. // Diffuse and specular lighting, with shadow receiving (but not casing).
  3. Shader "Google/Maps/Shaders/BaseMap Textured" {
  4. Properties {
  5. _Color ("Color", Color) = (1,1,1,1)
  6. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  7. _Glossiness ("Smoothness", Range(0,1)) = 0.5
  8. _Metallic ("Metallic", Range(0,1)) = 0.0
  9. }
  10. SubShader {
  11. Tags { "RenderType"="Opaque" }
  12. LOD 200
  13. // Basemap renders multiple coincident ground plane features so we have to
  14. // disable z testing (make it always succeed) to allow for overdraw.
  15. ZTest Always
  16. CGPROGRAM
  17. // Physically based Standard lighting model, and enable shadows on all
  18. // light types.
  19. #pragma surface surf Standard fullforwardshadows alpha:blend
  20. // Use shader model 3.0 target, to get nicer looking lighting.
  21. #pragma target 3.0
  22. // Input parameters.
  23. half _Glossiness;
  24. half _Metallic;
  25. fixed4 _Color;
  26. sampler2D _MainTex;
  27. // Vertex input.
  28. struct Input {
  29. float2 uv_MainTex;
  30. };
  31. // Surface shader itself.
  32. void surf (Input input, inout SurfaceOutputStandard output) {
  33. // Albedo comes from a texture tinted by color.
  34. fixed4 color = tex2D(_MainTex, input.uv_MainTex) * _Color;
  35. output.Albedo = color.rgb;
  36. // Metallic and smoothness come from slider variables.
  37. output.Metallic = _Metallic;
  38. output.Smoothness = _Glossiness;
  39. output.Alpha = color.a;
  40. }
  41. ENDCG
  42. }
  43. FallBack "Diffuse"
  44. }