Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 422d3d8

Browse files
committed
Fixed TAA not using Gather correctly in DX11 & PSSL compatible platforms
1 parent d810da5 commit 422d3d8

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

PostProcessing/Resources/Shaders/TAA.cginc

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
// -----------------------------------------------------------------------------
1111
// Solver
1212

13-
#define TAA_USE_GATHER4_FOR_DEPTH_SAMPLE (SHADER_TARGET >= 41)
14-
1513
#define TAA_USE_STABLE_BUT_GHOSTY_VARIANT 0
1614

1715
#if !defined(TAA_DILATE_MOTION_VECTOR_SAMPLE)
@@ -39,13 +37,7 @@ struct OutputSolver
3937
sampler2D _HistoryTex;
4038

4139
sampler2D _CameraMotionVectorsTexture;
42-
43-
#if TAA_USE_GATHER4_FOR_DEPTH_SAMPLE
44-
Texture2D _CameraDepthTexture;
45-
SamplerState sampler_CameraDepthTexture;
46-
#else
4740
sampler2D _CameraDepthTexture;
48-
#endif
4941

5042
float4 _HistoryTex_TexelSize;
5143
float4 _CameraDepthTexture_TexelSize;
@@ -74,20 +66,14 @@ VaryingsSolver VertSolver(AttributesDefault input)
7466
float2 GetClosestFragment(float2 uv)
7567
{
7668
const float2 k = _CameraDepthTexture_TexelSize.xy;
77-
78-
#if TAA_USE_GATHER4_FOR_DEPTH_SAMPLE
79-
const float4 neighborhood = _CameraDepthTexture.Gather(sampler_CameraDepthTexture, uv, int2(1, 1));
80-
float3 result = float3(0.0, 0.0, _CameraDepthTexture.Sample(sampler_CameraDepthTexture, uv).r);
81-
#else
8269
const float4 neighborhood = float4(
8370
SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv - k),
8471
SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + float2(k.x, -k.y)),
8572
SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + float2(-k.x, k.y)),
8673
SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + k)
8774
);
88-
float3 result = float3(0.0, 0.0, SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv));
89-
#endif
9075

76+
float3 result = float3(0.0, 0.0, SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv));
9177
result = lerp(result, float3(-1.0, -1.0, neighborhood.x), step(neighborhood.x, result.z));
9278
result = lerp(result, float3( 1.0, -1.0, neighborhood.y), step(neighborhood.y, result.z));
9379
result = lerp(result, float3(-1.0, 1.0, neighborhood.z), step(neighborhood.z, result.z));

0 commit comments

Comments
 (0)