FadeBlack.shader 784 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "Custom/FadeBlack"
  3. {
  4. Properties
  5. {
  6. _Fade ("Fade", Float) = 0.5
  7. }
  8. SubShader
  9. {
  10. Tags{ "Queue" = "Overlay" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
  11. Blend SrcAlpha OneMinusSrcAlpha
  12. ZTest Always
  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. };
  24. struct v2f
  25. {
  26. float4 vertex : SV_POSITION;
  27. };
  28. uniform fixed _Fade;
  29. v2f vert (appdata v)
  30. {
  31. v2f o;
  32. o.vertex = UnityObjectToClipPos(v.vertex);
  33. return o;
  34. }
  35. fixed4 frag (v2f i) : SV_Target
  36. {
  37. return fixed4(0,0,0,_Fade);
  38. }
  39. ENDCG
  40. }
  41. }
  42. }