diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 358ee147c47..17c57ca6cb0 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -673,6 +673,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed compile error in PS4 for planar reflection filtering. - Fixed issue with blue line in prefabs for volume mode. - Fixing the internsity being applied to RTAO too early leading to unexpected results (1254626). +- Fix issue that caused sky to incorrectly render when using a custom projection matrix. ### Changed - Improve MIP selection for decals on Transparents diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index e75b23d663c..e7fb67e6ed7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1275,6 +1275,10 @@ Matrix4x4 ComputePixelCoordToWorldSpaceViewDirectionMatrix(ViewConstants viewCon } float verticalFoV = camera.GetGateFittedFieldOfView() * Mathf.Deg2Rad; + if (!camera.usePhysicalProperties) + { + verticalFoV = Mathf.Atan(-1.0f / viewConstants.projMatrix[1, 1]) * 2; + } Vector2 lensShift = camera.GetGateFittedLensShift(); return HDUtils.ComputePixelCoordToWorldSpaceViewDirectionMatrix(verticalFoV, lensShift, resolution, viewConstants.viewMatrix, false, aspect);