NRBackground.shader 829 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Shader "NRSDK/NRBackground"
  2. {
  3. Properties
  4. {
  5. _MainTex("Texture", 2D) = "black" {}
  6. }
  7. SubShader
  8. {
  9. Tags { "Queue" = "Background-1" "RenderType" = "Opaque" }
  10. LOD 100
  11. Pass
  12. {
  13. CGPROGRAM
  14. #pragma vertex vert
  15. #pragma fragment frag
  16. #include "UnityCG.cginc"
  17. struct appdata
  18. {
  19. float4 vertex : POSITION;
  20. float2 uv : TEXCOORD0;
  21. };
  22. struct v2f
  23. {
  24. float2 uv : TEXCOORD0;
  25. UNITY_FOG_COORDS(1)
  26. float4 vertex : SV_POSITION;
  27. };
  28. sampler2D _MainTex;
  29. float4 _MainTex_ST;
  30. v2f vert(appdata v)
  31. {
  32. v2f o;
  33. o.vertex = UnityObjectToClipPos(v.vertex);
  34. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  35. return o;
  36. }
  37. fixed4 frag(v2f i) : SV_Target
  38. {
  39. // sample the texture
  40. fixed2 uv = fixed2(i.uv.x, 1 - i.uv.y);
  41. return tex2D(_MainTex, uv);
  42. }
  43. ENDCG
  44. }
  45. }
  46. }