-
-
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
Further improve 3D Map View performance #60672
base: master
Are you sure you want to change the base?
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
Tests failed for Qt 6One or more tests failed using the build from commit f702cb4 4978_line_rendering_1 (testEpsg4978LineRendering)4978_line_rendering_1Test failed at testEpsg4978LineRendering at tests/src/3d/testqgs3drendering.cpp:1828 Rendered image did not match tests/testdata/control_images/3d/expected_4978_line_rendering_1/expected_4978_line_rendering_1.png (found 100268 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 f702cb4 4978_line_rendering_1 (testEpsg4978LineRendering)4978_line_rendering_1Test failed at testEpsg4978LineRendering at tests/src/3d/testqgs3drendering.cpp:1828 Rendered image did not match tests/testdata/control_images/3d/expected_4978_line_rendering_1/expected_4978_line_rendering_1.png (found 100268 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. |
@dvdkon i'm not sure if it's related to the previous set of optimisations, but on current master there's a regression in 3d movement when using the mouse wheel to zoom in -- if a small zoom is performed quickly, the map will zoom in a HUGE amount. The same amount of movement zooming out works correctly. |
I can confirm that without #60246 zooming in works as usual |
Yes, I think we should. We can reintroduce it later with a fix |
a50d2b9
to
f702cb4
Compare
Done by adding frustum culling early in the loop, results in a ~10x speedup in one project.
f702cb4
to
7be4280
Compare
Description
This PR comprises two changes to the 3D view:
Decoupling entity visibility from the currently set near/far planes: Currently, which entities are visible depends on the near/far planes. However, adding/removing entities will likely change the near/far planes that are used as input. Currently, we just re-run the scene update once, but to do this properly we'd need to loop until the planes stabilise.
I instead propose not caring about the planes when selecting entities (by just choosing small/large enough constants), which is where the current process would converge to after enough frames anyway. This way, we get rid of the second (expensive)
updateScene()
call per frame, almost doubling frame rate, and reduce complexity as a bonus.Early culling in QgsVirtualPointCloudEntity: On each scene update, the VPC entity iterates over its constituent point clouds and calls their
handleSceneUpdate()
method. That will eventually do frustum culling somewhere inQgsChunkedEntity
, but we can get a significant speedup if we do the frustum culling on whole point clouds already in the VPC entity.