First Commit
This commit is contained in:
54
Assets/Scripts/ScreenFaderComposite.shader
Normal file
54
Assets/Scripts/ScreenFaderComposite.shader
Normal file
@@ -0,0 +1,54 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user