Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -96,6 +96,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed an issue causing errors in GenerateMaxZ when opaque objects or decals are disabled.
- Fixed an issue with Bake button of Reflection Probe when in custom mode
- Fixed exceptions related to the debug display settings when changing the default frame settings.
- Fixed issue when changing FoV with the physical camera fold-out closed.

### Changed
- Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ static void Drawer_Projection(SerializedHDCamera p, Editor owner)
? s_FovLastValue
: Camera.HorizontalToVerticalFieldOfView(s_FovLastValue, (p.serializedObject.targetObjects[0] as Camera).aspect);
}
else if (s_FovChanged && isPhysicalCamera && !p.projectionMatrixMode.hasMultipleDifferentValues)
{
// If we have a physical camera, we should also update the focal length here, because the
// Drawer_PhysicalCamera will not be executed if the physical camera fold-out is closed
cam.verticalFOV.floatValue = fovAxisVertical
? s_FovLastValue
: Camera.HorizontalToVerticalFieldOfView(s_FovLastValue, (p.serializedObject.targetObjects[0] as Camera).aspect);

float sensorLength = cam.fovAxisMode.intValue == 0 ? cam.sensorSize.vector2Value.y : cam.sensorSize.vector2Value.x;
float focalLengthVal = Camera.FieldOfViewToFocalLength(s_FovLastValue, sensorLength);
cam.focalLength.floatValue = EditorGUILayout.FloatField(focalLengthContent, focalLengthVal);
}

EditorGUILayout.Space();
}
Expand Down