|
10 | 10 | // -----------------------------------------------------------------------------
|
11 | 11 | // Solver
|
12 | 12 |
|
13 |
| -#define TAA_USE_GATHER4_FOR_DEPTH_SAMPLE (SHADER_TARGET >= 41) |
14 |
| - |
15 | 13 | #define TAA_USE_STABLE_BUT_GHOSTY_VARIANT 0
|
16 | 14 |
|
17 | 15 | #if !defined(TAA_DILATE_MOTION_VECTOR_SAMPLE)
|
@@ -39,13 +37,7 @@ struct OutputSolver
|
39 | 37 | sampler2D _HistoryTex;
|
40 | 38 |
|
41 | 39 | sampler2D _CameraMotionVectorsTexture;
|
42 |
| - |
43 |
| -#if TAA_USE_GATHER4_FOR_DEPTH_SAMPLE |
44 |
| -Texture2D _CameraDepthTexture; |
45 |
| -SamplerState sampler_CameraDepthTexture; |
46 |
| -#else |
47 | 40 | sampler2D _CameraDepthTexture;
|
48 |
| -#endif |
49 | 41 |
|
50 | 42 | float4 _HistoryTex_TexelSize;
|
51 | 43 | float4 _CameraDepthTexture_TexelSize;
|
@@ -74,20 +66,14 @@ VaryingsSolver VertSolver(AttributesDefault input)
|
74 | 66 | float2 GetClosestFragment(float2 uv)
|
75 | 67 | {
|
76 | 68 | 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 |
82 | 69 | const float4 neighborhood = float4(
|
83 | 70 | SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv - k),
|
84 | 71 | SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + float2(k.x, -k.y)),
|
85 | 72 | SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + float2(-k.x, k.y)),
|
86 | 73 | SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + k)
|
87 | 74 | );
|
88 |
| - float3 result = float3(0.0, 0.0, SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv)); |
89 |
| -#endif |
90 | 75 |
|
| 76 | + float3 result = float3(0.0, 0.0, SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv)); |
91 | 77 | result = lerp(result, float3(-1.0, -1.0, neighborhood.x), step(neighborhood.x, result.z));
|
92 | 78 | result = lerp(result, float3( 1.0, -1.0, neighborhood.y), step(neighborhood.y, result.z));
|
93 | 79 | result = lerp(result, float3(-1.0, 1.0, neighborhood.z), step(neighborhood.z, result.z));
|
|
0 commit comments