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.

55 lines
848 B

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