Blit.shader
983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Shader "Hidden/Post FX/Blit"
{
Properties
{
_MainTex("Main Texture", 2D) = "white" {}
}
CGINCLUDE
#include "UnityCG.cginc"
#include "Common.cginc"
struct Varyings
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
Varyings VertBlit(AttributesDefault v)
{
Varyings o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST);
return o;
}
half4 FragBlit(Varyings i) : SV_Target
{
half4 col = tex2D(_MainTex, i.uv);
return col;
}
ENDCG
SubShader
{
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex VertBlit
#pragma fragment FragBlit
ENDCG
}
}
}