Skip to content

Fix volumetric fog nan #2174

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
Oct 12, 2020
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 @@ -152,6 +152,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed issue with several override entries in the runtime debug menu.
- Fixed issue with rendergraph failing to execute every 30 minutes.
- Fixed Lit ShaderGraph surface option property block to only display transmission and energy conserving specular color options for their proper material mode (case 1257050)
- Fixed nan in reflection probe when volumetric fog filtering is enabled, causing the whole probe to be invalid.

### Changed
- Preparation pass for RTSSShadows to be supported by render graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ void FilterVolumetricLighting(uint3 dispatchThreadId : SV_DispatchThreadID,

// If this is outside of the image, force the weight to 0
#ifdef VERTICAL_PASS
if (tapCoord.y < 0.0 || tapCoord.y >= _VBufferViewportSize.y) weight = 0;
if (tapCoord.y < 0.0 || tapCoord.y >= _VBufferViewportSize.y)
#else
if (tapCoord.x < 0.0|| tapCoord.x >= _VBufferViewportSize.x) weight = 0;
if (tapCoord.x < 0.0 || tapCoord.x >= _VBufferViewportSize.x)
#endif
{
// To avoid NaNs, we have to override this value
currentValue = 0.0f;
weight = 0.0f;
}

// Accumulate the value and weight
value += currentValue * weight;
Expand Down