Skip to content

[HDRP] Fix issue with path tracing when switching between non-persistent cameras #5246

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
Jul 29, 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 @@ -335,6 +335,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed some of the extreme ghosting in DLSS by using a bit mask to bias the color of particles. VFX tagged as Exclude from TAA will be on this pass.
- Fixed update order in Graphics Compositor causing jumpy camera updates (case 1345566).
- Fixed material inspector that allowed setting intensity to an infinite value.
- Fixed issue when switching between non-persistent cameras when path tarcing is enabled (case 1337843).

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ TextureHandle RenderPathTracing(RenderGraph renderGraph, HDCamera hdCamera, Text
int camID = hdCamera.camera.GetInstanceID();
CameraData camData = m_SubFrameManager.GetCameraData(camID);

// Check if the camera has a valid history buffer and if not reset the accumulation.
// This can happen if a script disables and re-enables the camera (case 1337843).
if (!hdCamera.isPersistent && hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.PathTracing) == null)
{
m_SubFrameManager.Reset(camID);
}

if (!m_SubFrameManager.isRecording)
{
// Check if things have changed and if we need to restart the accumulation
Expand Down