Skip to content

Commit 93e565c

Browse files
FrancescoC-unitysebastienlagarde
authored andcommitted
Recompute FOV when generating PixelCoord To WorldSpace View Direction Matrix #865
1 parent 1bf01cd commit 93e565c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2020
- Fixed wrong order of post process frame settings.
2121
- Fixed warning in HDAdditionalLightData OnValidate (cases 1250864, 1244578)
2222
- Fixed issue with blue line in prefabs for volume mode.
23+
- Fix issue that caused sky to incorrectly render when using a custom projection matrix.
2324

2425
## [7.4.1] - 2020-06-03
2526

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,10 @@ Matrix4x4 ComputePixelCoordToWorldSpaceViewDirectionMatrix(ViewConstants viewCon
12131213
}
12141214

12151215
float verticalFoV = camera.GetGateFittedFieldOfView() * Mathf.Deg2Rad;
1216+
if (!camera.usePhysicalProperties)
1217+
{
1218+
verticalFoV = Mathf.Atan(-1.0f / viewConstants.projMatrix[1, 1]) * 2;
1219+
}
12161220
Vector2 lensShift = camera.GetGateFittedLensShift();
12171221

12181222
return HDUtils.ComputePixelCoordToWorldSpaceViewDirectionMatrix(verticalFoV, lensShift, resolution, viewConstants.viewMatrix, false, aspect);

0 commit comments

Comments
 (0)