You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.1 KiB

5 years ago
  1. Shader "Fog Volume/RT viewers/RT_FogVolume"
  2. {
  3. Properties{
  4. [Toggle(RightEye)] _RightEye ("Right Eye?", Float) = 0
  5. [hideininspector] _MainTex("Base", 2D) = "" {}
  6. }
  7. SubShader
  8. {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 100
  11. Pass
  12. {
  13. CGPROGRAM
  14. #pragma vertex vert
  15. #pragma fragment frag
  16. #pragma multi_compile _ RightEye
  17. #include "UnityCG.cginc"
  18. #define red float4(1, 0,0,1)
  19. struct appdata
  20. {
  21. float4 vertex : POSITION;
  22. float2 uv : TEXCOORD0;
  23. };
  24. struct v2f
  25. {
  26. float2 uv : TEXCOORD0;
  27. float4 vertex : SV_POSITION;
  28. };
  29. sampler2D RT_FogVolume;
  30. sampler2D RT_FogVolumeR;
  31. float4 RT_FogVolume_ST;
  32. v2f vert (appdata v)
  33. {
  34. v2f o;
  35. o.vertex = UnityObjectToClipPos(v.vertex);
  36. o.uv = TRANSFORM_TEX(v.uv, RT_FogVolume);
  37. return o;
  38. }
  39. fixed4 frag (v2f i) : SV_Target
  40. {
  41. // sample the texture
  42. fixed4 col = 0;
  43. #ifdef RightEye
  44. col = tex2D(RT_FogVolumeR, i.uv)/**red*/;
  45. #else
  46. col = tex2D(RT_FogVolume, i.uv)/**red*/;
  47. #endif
  48. return col;
  49. }
  50. ENDCG
  51. }
  52. }
  53. }