Sky360 VR.shader 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Shader "Custom/Sky360 VR" {
  2. Properties {
  3. _MainTex ("Sky texture", 2D) = "white" {}
  4. _ColorTint("Color", Color) = (1, 1, 1, 1)
  5. // _MainTex_ST("Texture Tiling/Offset", Vector) = (1, 1, 0, 0)
  6. }
  7. SubShader {
  8. Tags { "Queue"="Geometry+800" "RenderType"="Opaque" }
  9. LOD 100
  10. Pass {
  11. CGPROGRAM
  12. #pragma vertex vert
  13. #pragma fragment frag
  14. #pragma multi_compile_instancing
  15. #include "UnityCG.cginc"
  16. sampler2D _MainTex;
  17. float4 _MainTex_ST;
  18. float4 _ColorTint;
  19. struct appdata {
  20. float4 vertex : POSITION;
  21. float2 uv : TEXCOORD0;
  22. UNITY_VERTEX_INPUT_INSTANCE_ID
  23. };
  24. struct v2f {
  25. float4 pos : SV_POSITION;
  26. float2 uv : TEXCOORD0;
  27. fixed4 color : COLOR;
  28. UNITY_VERTEX_OUTPUT_STEREO
  29. };
  30. v2f vert (appdata v)
  31. {
  32. v2f o;
  33. UNITY_SETUP_INSTANCE_ID(v);
  34. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  35. o.pos = UnityObjectToClipPos(v.vertex);
  36. o.uv = TRANSFORM_TEX(v.uv * _MainTex_ST.xy + _MainTex_ST.zw, _MainTex);
  37. o.uv.y *= -1;
  38. o.color = _ColorTint;
  39. o.color = _ColorTint;
  40. return o;
  41. }
  42. fixed4 frag (v2f i) : SV_Target {
  43. fixed4 tex = tex2D(_MainTex, i.uv);
  44. return tex * i.color;
  45. }
  46. ENDCG
  47. }
  48. }
  49. FallBack "Diffuse"
  50. }