Files
SampleRenderPasses/Assets/Scripts/ScreenFaderComposite.shader
2025-05-18 22:39:39 +03:00

55 lines
886 B
Plaintext

Shader "Hidden/ScreenFaderComposite"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
float2 uv0 : TEXCOORD0;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv0 = v.uv;
return o;
}
sampler2D _MainTex;
half4 _MainTex_ST;
fixed4 _FadeColour;
fixed4 frag (v2f i) : SV_Target
{
fixed4 colour = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv0, _MainTex_ST));
colour.xyz = colour.xyz * (1.0 - _FadeColour.a) + _FadeColour.xyz * _FadeColour.a;
return colour;
}
ENDCG
}
}
}