Skip to content

Commit 0d9cb81

Browse files
[HDRP] Fixed taa jitter for after post process materials (#6320)
* [HDRP] Fixed taa jitter for after post process materials * Remove UpdateShaderVariablesGlobalCB * Only do it if camera has jittering * Update screenshots Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
1 parent 0df9a3f commit 0d9cb81

File tree

7 files changed

+25
-10
lines changed

7 files changed

+25
-10
lines changed
Loading
Loading
Loading
Loading
Loading

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4444
- Fixed Nans happening due to volumetric clouds when the pixel color is perfectly black (case 1379185).
4545
- Fixed for screen space overlay rendered by camera when HDR is disabled.
4646
- Fixed dirtiness handling in path tracing, when using multiple cameras at once (case 1376940).
47+
- Fixed taa jitter for after post process materials (case 1380967).
4748

4849
### Changed
4950
- Optimizations for the physically based depth of field.

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,13 +953,27 @@ TextureHandle RenderAfterPostProcessObjects(RenderGraph renderGraph, HDCamera hd
953953
builder.SetRenderFunc(
954954
(AfterPostProcessPassData data, RenderGraphContext ctx) =>
955955
{
956+
// Disable camera jitter. See coment in RestoreNonjitteredMatrices
957+
if (data.hdCamera.RequiresCameraJitter())
958+
{
959+
data.hdCamera.UpdateAllViewConstants(false);
960+
data.hdCamera.UpdateShaderVariablesGlobalCB(ref data.globalCB);
961+
}
962+
956963
UpdateOffscreenRenderingConstants(ref data.globalCB, true, 1.0f);
957964
ConstantBuffer.PushGlobal(ctx.cmd, data.globalCB, HDShaderIDs._ShaderVariablesGlobal);
958965

959966
DrawOpaqueRendererList(ctx.renderContext, ctx.cmd, data.hdCamera.frameSettings, data.opaqueAfterPostprocessRL);
960967
// Setup off-screen transparency here
961968
DrawTransparentRendererList(ctx.renderContext, ctx.cmd, data.hdCamera.frameSettings, data.transparentAfterPostprocessRL);
962969

970+
// Reenable camera jitter for CustomPostProcessBeforeTAA injection point
971+
if (data.hdCamera.RequiresCameraJitter())
972+
{
973+
data.hdCamera.UpdateAllViewConstants(true);
974+
data.hdCamera.UpdateShaderVariablesGlobalCB(ref data.globalCB);
975+
}
976+
963977
UpdateOffscreenRenderingConstants(ref data.globalCB, false, 1.0f);
964978
ConstantBuffer.PushGlobal(ctx.cmd, data.globalCB, HDShaderIDs._ShaderVariablesGlobal);
965979
});

0 commit comments

Comments
 (0)