VolumetricFogDebug.shader 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Shader "Hidden/VolumetricFog2/VolumeDebug"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Texture", 2D) = "white" {}
  6. _Color("Color", Color) = (1,1,1)
  7. }
  8. SubShader
  9. {
  10. Tags { "Queue"="Transparent+101" "RenderType"="Transparent" }
  11. Blend SrcAlpha OneMinusSrcAlpha
  12. Cull Off
  13. ZWrite Off
  14. Pass
  15. {
  16. CGPROGRAM
  17. #pragma vertex vert
  18. #pragma fragment frag
  19. #include "UnityCG.cginc"
  20. struct appdata
  21. {
  22. float4 vertex : POSITION;
  23. float2 uv : TEXCOORD0;
  24. };
  25. struct v2f
  26. {
  27. float4 vertex : SV_POSITION;
  28. float2 uv : TEXCOORD0;
  29. };
  30. v2f vert (appdata v)
  31. {
  32. v2f o;
  33. o.vertex = UnityObjectToClipPos(v.vertex);
  34. o.uv = v.uv;
  35. return o;
  36. }
  37. fixed4 frag (v2f i) : SV_Target
  38. {
  39. float2 dd = abs(i.uv.xy - 0.5) * 2.0;
  40. float d = max(dd.x, dd.y);
  41. half b = 0.05 + 0.95 * (d > 0.995);
  42. return half4(1,1,1,b);
  43. }
  44. ENDCG
  45. }
  46. }
  47. }