BaseMapTexturedUnlit.shader 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // BaseMap shader for use on ground/water regions.
  2. // Unlit version.
  3. Shader "Google/Maps/Shaders/BaseMap Textured, Unlit" {
  4. Properties {
  5. _Color ("Color", Color) = (1,1,1,1)
  6. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  7. }
  8. SubShader {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 200
  11. // Basemap renders multiple coincident ground plane features so we have to
  12. // disable z testing (make it always succeed) to allow for overdraw.
  13. ZTest Always
  14. CGPROGRAM
  15. #pragma surface surf NoLighting noambient noshadow alpha:blend
  16. // Input parameters.
  17. sampler2D _MainTex;
  18. fixed4 _Color;
  19. // Vertex input.
  20. struct Input {
  21. half2 uv_MainTex;
  22. };
  23. // Custom lighting model (which just returns unlit color).
  24. fixed4 LightingNoLighting(SurfaceOutput surface, fixed3 lightDirection,
  25. fixed attenutation) {
  26. fixed4 color;
  27. color.rgb = surface.Albedo;
  28. color.a = surface.Alpha;
  29. return color;
  30. }
  31. // Surface shader itself.
  32. void surf (Input input, inout SurfaceOutput output) {
  33. fixed4 color = tex2D(_MainTex, input.uv_MainTex) * _Color;
  34. output.Albedo = color.rgb;
  35. output.Alpha = color.a;
  36. }
  37. ENDCG
  38. }
  39. Fallback "Unlit/Texture"
  40. }