@@ -9,20 +9,6 @@ Shader "Hidden/PostProcessing/MultiScaleVO"
9
9
TEXTURE2D_SAMPLER2D (_MSVOcclusionTexture, sampler_MSVOcclusionTexture);
10
10
float3 _AOColor;
11
11
12
- VaryingsDefault Vert (AttributesDefault v)
13
- {
14
- VaryingsDefault o;
15
- o.vertex = float4 (v.vertex.xy, 0.0 , 1.0 );
16
- o.texcoord = TransformTriangleVertexToUV (v.vertex.xy);
17
-
18
- #if UNITY_UV_STARTS_AT_TOP
19
- o.texcoord = o.texcoord * float2 (1.0 , -1.0 ) + float2 (0.0 , 1.0 );
20
- #endif
21
-
22
- o.texcoord = TransformStereoScreenSpaceTex (o.texcoord, 1 );
23
- return o;
24
- }
25
-
26
12
ENDHLSL
27
13
28
14
SubShader
@@ -34,12 +20,12 @@ Shader "Hidden/PostProcessing/MultiScaleVO"
34
20
{
35
21
HLSLPROGRAM
36
22
37
- #pragma vertex Vert
23
+ #pragma vertex VertDefault
38
24
#pragma fragment Frag
39
25
40
26
float4 Frag (VaryingsDefault i) : SV_Target
41
27
{
42
- return SAMPLE_DEPTH_TEXTURE (_CameraDepthTexture, sampler_CameraDepthTexture, i.texcoord );
28
+ return SAMPLE_DEPTH_TEXTURE (_CameraDepthTexture, sampler_CameraDepthTexture, i.texcoordStereo );
43
29
}
44
30
45
31
ENDHLSL
@@ -52,7 +38,7 @@ Shader "Hidden/PostProcessing/MultiScaleVO"
52
38
53
39
HLSLPROGRAM
54
40
55
- #pragma vertex Vert
41
+ #pragma vertex VertDefault
56
42
#pragma fragment Frag
57
43
58
44
struct Output
@@ -63,7 +49,7 @@ Shader "Hidden/PostProcessing/MultiScaleVO"
63
49
64
50
Output Frag (VaryingsDefault i)
65
51
{
66
- float ao = 1.0 - SAMPLE_TEXTURE2D (_MSVOcclusionTexture, sampler_MSVOcclusionTexture, i.texcoord ).r;
52
+ float ao = 1.0 - SAMPLE_TEXTURE2D (_MSVOcclusionTexture, sampler_MSVOcclusionTexture, i.texcoordStereo ).r;
67
53
Output o;
68
54
o.gbuffer0 = float4 (0.0 , 0.0 , 0.0 , ao);
69
55
o.gbuffer3 = float4 (ao * _AOColor, 0.0 );
@@ -82,17 +68,16 @@ Shader "Hidden/PostProcessing/MultiScaleVO"
82
68
83
69
#pragma multi_compile _ APPLY_FORWARD_FOG
84
70
#pragma multi_compile _ FOG_LINEAR FOG_EXP FOG_EXP2
85
- #pragma vertex Vert
71
+ #pragma vertex VertDefault
86
72
#pragma fragment Frag
87
73
88
74
float4 Frag (VaryingsDefault i) : SV_Target
89
75
{
90
- float2 texcoord = TransformStereoScreenSpaceTex (i.texcoord, 1 );
91
- half ao = 1.0 - SAMPLE_TEXTURE2D (_MSVOcclusionTexture, sampler_MSVOcclusionTexture, texcoord).r;
76
+ half ao = 1.0 - SAMPLE_TEXTURE2D (_MSVOcclusionTexture, sampler_MSVOcclusionTexture, i.texcoordStereo).r;
92
77
93
78
// Apply fog when enabled (forward-only)
94
79
#if (APPLY_FORWARD_FOG)
95
- float d = Linear01Depth (SAMPLE_DEPTH_TEXTURE (_CameraDepthTexture, sampler_CameraDepthTexture, texcoord ));
80
+ float d = Linear01Depth (SAMPLE_DEPTH_TEXTURE (_CameraDepthTexture, sampler_CameraDepthTexture, i.texcoordStereo ));
96
81
d = ComputeFogDistance (d);
97
82
ao *= ComputeFog (d);
98
83
#endif
@@ -108,12 +93,12 @@ Shader "Hidden/PostProcessing/MultiScaleVO"
108
93
{
109
94
HLSLPROGRAM
110
95
111
- #pragma vertex Vert
96
+ #pragma vertex VertDefault
112
97
#pragma fragment Frag
113
98
114
99
float4 Frag (VaryingsDefault i) : SV_Target
115
100
{
116
- half ao = SAMPLE_TEXTURE2D (_MSVOcclusionTexture, sampler_MSVOcclusionTexture, i.texcoord ).r;
101
+ half ao = SAMPLE_TEXTURE2D (_MSVOcclusionTexture, sampler_MSVOcclusionTexture, i.texcoordStereo ).r;
117
102
return float4 (ao.rrr, 1.0 );
118
103
}
119
104
0 commit comments