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

Commit 20f1835

Browse files
committed
Removed useless shader pass in TAA
First stone for the "keep alpha" mode (needed for AR)
1 parent 6350fd5 commit 20f1835

2 files changed

Lines changed: 5 additions & 23 deletions

File tree

PostProcessing/Runtime/Effects/TemporalAntialiasing.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public sealed class TemporalAntialiasing
3030
enum Pass
3131
{
3232
SolverDilate,
33-
SolverNoDilate,
34-
AlphaClear
33+
SolverNoDilate
3534
}
3635

3736
readonly RenderTargetIdentifier[] m_Mrt = new RenderTargetIdentifier[2];
@@ -155,7 +154,7 @@ public void SetProjectionMatrix(Camera camera)
155154
jitter = new Vector2(jitter.x / camera.pixelWidth, jitter.y / camera.pixelHeight);
156155
}
157156

158-
RenderTexture CheckHistory(int id, PostProcessRenderContext context, PropertySheet sheet)
157+
RenderTexture CheckHistory(int id, PostProcessRenderContext context)
159158
{
160159
var rt = m_HistoryTextures[id];
161160

@@ -168,7 +167,7 @@ RenderTexture CheckHistory(int id, PostProcessRenderContext context, PropertyShe
168167
rt.filterMode = FilterMode.Bilinear;
169168
m_HistoryTextures[id] = rt;
170169

171-
context.command.BlitFullscreenTriangle(context.source, rt, sheet, (int)Pass.AlphaClear);
170+
context.command.BlitFullscreenTriangle(context.source, rt);
172171
}
173172
else if (rt.width != context.width || rt.height != context.height)
174173
{
@@ -194,8 +193,8 @@ internal void Render(PostProcessRenderContext context)
194193
cmd.BeginSample("TemporalAntialiasing");
195194

196195
int pp = m_HistoryPingPong;
197-
var historyRead = CheckHistory(++pp % 2, context, sheet);
198-
var historyWrite = CheckHistory(++pp % 2, context, sheet);
196+
var historyRead = CheckHistory(++pp % 2, context);
197+
var historyWrite = CheckHistory(++pp % 2, context);
199198
m_HistoryPingPong = ++pp % 2;
200199

201200
const float kMotionAmplification = 100f * 60f;

PostProcessing/Shaders/Builtins/TemporalAntialiasing.shader

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ Shader "Hidden/PostProcessing/TemporalAntialiasing"
148148
return Solve(motion, i.texcoord);
149149
}
150150

151-
float4 FragAlphaClear(VaryingsDefault i) : SV_Target
152-
{
153-
float3 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord).rgb;
154-
return float4(color, 0.0);
155-
}
156-
157151
ENDHLSL
158152

159153
SubShader
@@ -181,16 +175,5 @@ Shader "Hidden/PostProcessing/TemporalAntialiasing"
181175

182176
ENDHLSL
183177
}
184-
185-
// 2: Alpha clear
186-
Pass
187-
{
188-
HLSLPROGRAM
189-
190-
#pragma vertex VertDefault
191-
#pragma fragment FragAlphaClear
192-
193-
ENDHLSL
194-
}
195178
}
196179
}

0 commit comments

Comments
 (0)