TexturePointerShader.shader 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Shader "FFALCON/TexturePointerShader"
  2. {
  3. Properties
  4. {
  5. _MainTex("Texture", 2D) = "white" {}
  6. _DistanceInMeters("DistanceInMeters", Range(0.0, 10000.0)) = 2.0
  7. _ScaleValue("ScaleValue", Range(0, 999)) = 1.5
  8. }
  9. SubShader
  10. {
  11. Tags { "Queue" = "Overlay" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
  12. LOD 100
  13. Pass
  14. {
  15. Blend SrcAlpha OneMinusSrcAlpha, OneMinusDstAlpha One
  16. AlphaTest Off
  17. Cull Back
  18. Lighting Off
  19. ZWrite Off
  20. ZTest Always
  21. CGPROGRAM
  22. #pragma vertex vert
  23. #pragma fragment frag
  24. // make fog work
  25. #pragma multi_compile_fog
  26. #include "UnityCG.cginc"
  27. struct appdata
  28. {
  29. float4 vertex : POSITION;
  30. float2 uv : TEXCOORD0;
  31. };
  32. struct v2f
  33. {
  34. float2 uv : TEXCOORD0;
  35. UNITY_FOG_COORDS(1)
  36. float4 vertex : SV_POSITION;
  37. };
  38. sampler2D _MainTex;
  39. float4 _MainTex_ST;
  40. uniform float _DistanceInMeters;
  41. uniform float _ScaleValue;
  42. v2f vert(appdata v)
  43. {
  44. float3 vert_out = float3(v.vertex.x * _ScaleValue, v.vertex.y * _ScaleValue, _DistanceInMeters);
  45. v2f o;
  46. o.vertex = UnityObjectToClipPos(vert_out);
  47. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  48. return o;
  49. }
  50. fixed4 frag(v2f i) : SV_Target
  51. {
  52. // sample the texture
  53. fixed4 col = tex2D(_MainTex, i.uv);
  54. return col;
  55. }
  56. ENDCG
  57. }
  58. }
  59. }