Skip to content

[HDRP] Fix rasterized accumulation motion blur when DoF is enabled #6380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed stackLit coat screen space reflection and raytrace reflection light hierarchy and IBL fallback
- Fixed compilation errors from Path Tracing on the PS5 build.
- Fixed custom shader GUI for material inspector.
- Fixed rasterized accumulation motion blur when DoF is enabled (case 1378497).

### Changed
- Optimizations for the physically based depth of field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph,

source = DepthOfFieldPass(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, depthMinMaxAvgMSAA, prepassOutput.stencilBuffer);

if (m_DepthOfField.IsActive() && m_SubFrameManager.isRecording && m_SubFrameManager.subFrameCount > 1)
{
RenderAccumulation(m_RenderGraph, hdCamera, source, source, false);
}

// Motion blur after depth of field for aesthetic reasons (better to see motion
// blurred bokeh rather than out of focus motion blur)
source = MotionBlurPass(renderGraph, hdCamera, depthBuffer, motionVectors, source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ void RecordRenderGraph(RenderRequest renderRequest,
PushFullScreenDebugTexture(m_RenderGraph, colorBuffer, FullScreenDebugMode.WorldSpacePosition, fullScreenDebugFormat);
PushFullScreenLightingDebugTexture(m_RenderGraph, colorBuffer, fullScreenDebugFormat);

if (m_SubFrameManager.isRecording && m_SubFrameManager.subFrameCount > 1)
bool accumulateInPost = m_PostProcessEnabled && m_DepthOfField.IsActive();
if (!accumulateInPost && m_SubFrameManager.isRecording && m_SubFrameManager.subFrameCount > 1)
{
RenderAccumulation(m_RenderGraph, hdCamera, colorBuffer, colorBuffer, false);
}
Expand Down