Skip to content

Commit

Permalink
Fix for potentially corrupted refraction result on xbox #1699
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoC-unity authored and sebastienlagarde committed Nov 16, 2020
1 parent 8c9eecd commit 64aea03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
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 @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed "Screen position out of view frustum" error when camera is at exactly the planar reflection probe location.
- Fixed issue with diffusion profile not being updated upon reset of the editor.
- Fixed Amplitude -> Min/Max parametrization conversion
- Fixed an issue that lead to corrupted refraction in some scenarios on xbox.

### Changed
- Remove MSAA debug mode when renderpipeline asset has no MSAA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ float IntersectSphereProxy(EnvLightData lightData, float3 dirPS, float3 position
{
float sphereOuterDistance = lightData.proxyExtents.x;
float projectionDistance = IntersectRaySphereSimple(positionPS, dirPS, sphereOuterDistance);
projectionDistance = IsNaN(projectionDistance) ? -1.0f : projectionDistance; // Note that because we use IntersectRaySphereSimple, in case of a ill-set proxy, it could be that
// the determinant in the ray-sphere intersection code ends up negative, leading to a NaN.
// Rather than complicating the IntersectRaySphereSimple or switching to a more complex case, we cover that case this way.
projectionDistance = max(projectionDistance, lightData.minProjectionDistance); // Setup projection to infinite if requested (mean no projection shape)

return projectionDistance;
Expand Down

0 comments on commit 64aea03

Please sign in to comment.