Skip to content

Fix white flash on camera cuts with volumetric #3354

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
Feb 3, 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 @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed lights shadow frustum near and far planes.
- Fixed various issues with non-temporal SSAO and rendergraph.
- Fix screen being over-exposed when changing very different skies.
- White flashes on camera cuts on volumetric fog.

### Changed
- Removed the material pass probe volumes evaluation mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public struct ViewConstants
/// <summary>Volumetric history buffer state.</summary>
public bool volumetricHistoryIsValid = false;

internal int volumetricValidFrames = 0;

/// <summary>Width actually used for rendering after dynamic resolution and XR is applied.</summary>
public int actualWidth { get; private set; }
/// <summary>Height actually used for rendering after dynamic resolution and XR is applied.</summary>
Expand Down Expand Up @@ -129,6 +131,7 @@ public void Reset()
cameraFrameCount = 0;
resetPostProcessingHistory = true;
volumetricHistoryIsValid = false;
volumetricValidFrames = 0;
colorPyramidHistoryIsValid = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,10 @@ TextureHandle VolumetricLightingPass(RenderGraph renderGraph, HDCamera hdCamera,
FilterVolumetricLighting(data.parameters, data.lightingBuffer, ctx.cmd);
});

if (parameters.enableReprojection)
if (parameters.enableReprojection && hdCamera.volumetricValidFrames > 1)
hdCamera.volumetricHistoryIsValid = true; // For the next frame..
else
hdCamera.volumetricValidFrames++;

return passData.lightingBuffer;
}
Expand Down