-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[3D] correctly compute near/far planes when a scene is reloaded #55632
Conversation
99d04df
to
7424be3
Compare
7424be3
to
4d3f699
Compare
Tests failed for Qt 6One or more tests failed using the build from commit ffd4bd2 polygon3d_extrusion_opacity (testExtrudedPolygons)polygon3d_extrusion_opacityTest failed at testExtrudedPolygons at tests/src/3d/testqgs3drendering.cpp:453 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_opacity/expected_polygon3d_extrusion_opacity.png (found 147 pixels different) polygon3d_extrusion_data_defined (testExtrudedPolygonsDataDefined)polygon3d_extrusion_data_definedTest failed at testExtrudedPolygonsDataDefined at tests/src/3d/testqgs3drendering.cpp:556 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined/expected_polygon3d_extrusion_data_defined.png (found 66 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
Tests failed for Qt 5One or more tests failed using the build from commit ffd4bd2 polygon3d_extrusion_opacity (testExtrudedPolygons)polygon3d_extrusion_opacityTest failed at testExtrudedPolygons at tests/src/3d/testqgs3drendering.cpp:453 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_opacity/expected_polygon3d_extrusion_opacity.png (found 147 pixels different) polygon3d_extrusion_data_defined (testExtrudedPolygonsDataDefined)polygon3d_extrusion_data_definedTest failed at testExtrudedPolygonsDataDefined at tests/src/3d/testqgs3drendering.cpp:556 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined/expected_polygon3d_extrusion_data_defined.png (found 61 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
Off topic, but do you notice the light intensity increase which happens when the settings are changed? I've tried to track this down and have had no luck... I suspect it's a qt3d internal bug. 😢 |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
d271022
to
ffd4bd2
Compare
@ptitjano can you use test mask updates for the test images instead of replacing the reference image? There's only a handful of pixels different, so the mask should be used instead. |
f76a863
to
520b1a9
Compare
Done |
@ptitjano please rebase... |
520b1a9
to
5ba923b
Compare
`Qgs3DNavigationWidget` is updated when the camera parameters are updated by `QgsCameraController`. However, the near far planes of the camera can be updated from the `Qgs3DMapScene`. In that case, the `Qgs3DNavigationWidget` also neeeds to be updated. This issue is fixed by listening to the near/far plane changes from the scene camera in `Qgs3DMapCanvas`.
The near/far planes are computed in `Qgs3DMapScene` when the camera parameters have changed. Their values depend on the bounding boxes of the visible entities. However, the near and far planes are not recomputed when a new entity is added. This can be problematic for entities from a vector layer because their vertical extent is unknown when the associated bounding boxes are created. This issue is fixed by calling `Qgs3DMapscene::updateCameraNearFarPlanes` when a new scene entity is created. Indeed, on a new scene entity, the exact exact bounding box has been computed by the loader of the chunked entity.
5ba923b
to
44bb58d
Compare
Done |
From the main commit:
Description
Current behavior : the far plane is not correct when the scene is reloaded
near_far.webm
Fixed behavior with this PR: far plane computation is correct
near_far_after.webm
cc @benoitdm-oslandia @wonder-sk @uclaros