Landscape Unlit.shader 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Shader "Custom/Landscape Unlit" {
  2. Properties {
  3. _MainTex ("Texture", 2D) = "white" {}
  4. _Color ("Color", Color) = (1,1,1,1)
  5. _Xtiling ("X Tiling", Range(1,10)) = 1
  6. }
  7. SubShader {
  8. Tags {"Queue"="Transparent" "RenderType"="Transparent" }
  9. LOD 100
  10. Pass {
  11. ZWrite Off
  12. Blend SrcAlpha OneMinusSrcAlpha
  13. Cull Off
  14. CGPROGRAM
  15. #pragma vertex vert
  16. #pragma fragment frag
  17. #include "UnityCG.cginc"
  18. struct appdata_t {
  19. float4 vertex : POSITION;
  20. float4 color : COLOR;
  21. float2 uv : TEXCOORD0;
  22. };
  23. struct v2f {
  24. float2 uv : TEXCOORD0;
  25. float4 color : COLOR;
  26. float4 vertex : SV_POSITION;
  27. };
  28. sampler2D _MainTex;
  29. float4 _MainTex_ST;
  30. float4 _Color;
  31. int _Xtiling;
  32. v2f vert (appdata_t v) {
  33. v2f o;
  34. o.vertex = UnityObjectToClipPos(v.vertex);
  35. o.uv = float2(v.uv.x * _Xtiling, v.uv.y);
  36. o.color = v.color * _Color;
  37. return o;
  38. }
  39. fixed4 frag (v2f i) : SV_Target {
  40. fixed4 col = tex2D(_MainTex, i.uv.xy);
  41. col *= i.color;
  42. col.a *= _Color.a;
  43. return col;
  44. }
  45. ENDCG
  46. }
  47. }
  48. FallBack "Sprites/Default"
  49. }