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

Commit 08b1319

Browse files
committed
Fixed projection matrix for the transparent pass when TAA is toggled off
1 parent 8ebad26 commit 08b1319

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

PostProcessing/Runtime/PostProcessLayer.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ void OnPreCull()
251251
var context = m_CurrentContext;
252252
var sourceFormat = m_Camera.allowHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default;
253253

254+
// Resets the projection matrix from previous frame in case TAA was enabled.
255+
// We also need to force reset the non-jittered projection matrix here as it's not done
256+
// when ResetProjectionMatrix() is called and will break transparent rendering if TAA
257+
// is switched off and the FOV or any other camera property changes.
258+
m_Camera.ResetProjectionMatrix();
259+
m_Camera.nonJitteredProjectionMatrix = m_Camera.projectionMatrix;
260+
254261
context.Reset();
255262
context.camera = m_Camera;
256263
context.sourceFormat = sourceFormat;
@@ -356,16 +363,6 @@ void OnPreCull()
356363
m_LegacyCmdBuffer.ReleaseTemporaryRT(tempRt);
357364
}
358365

359-
void OnPostRender()
360-
{
361-
// Unused in scriptable render pipelines
362-
if (RuntimeUtilities.scriptableRenderPipelineActive)
363-
return;
364-
365-
if (m_CurrentContext.IsTemporalAntialiasingActive())
366-
m_Camera.ResetProjectionMatrix();
367-
}
368-
369366
PostProcessBundle GetBundle<T>()
370367
where T : PostProcessEffectSettings
371368
{

0 commit comments

Comments
 (0)