cosmoscout / cosmoscout-vr

:milky_way: A virtual universe which lets you explore, analyze and present huge planetary datasets and large simulation data in real-time.
Other
351 stars 27 forks source link

Refactor Celestial Anchors #298

Closed Schneegans closed 1 year ago

Schneegans commented 2 years ago

This major refactoring reduces the CPU load of scenes containing many celestial bodies significantly. The primary change is a shift from inheritance to composition when it comes to the celestial anchors. For the default scene, the time to update the SolarSystem has been reduced by more than 50% (on my machine from 11 ms to 5 ms).

Primary Changes

Other Changes

csp-anchor-labels

csp-measurement-tools

csp-satellites

csp-wms-overlays

Future Work

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 3164757767


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cs-core/GraphicsEngine.cpp 0 1 0.0%
src/cs-scene/CelestialObject.hpp 0 1 0.0%
src/cs-scene/CelestialSurface.hpp 0 1 0.0%
plugins/csp-vr-accessibility/src/FovVignette.cpp 0 2 0.0%
src/cs-scene/CelestialAnchor.hpp 0 2 0.0%
plugins/csp-fly-to-locations/src/Plugin.cpp 0 3 0.0%
src/cosmoscout/ObserverNavigationNode.cpp 0 3 0.0%
src/cs-core/tools/DeletableMark.cpp 0 3 0.0%
src/cs-graphics/Shadows.cpp 0 4 0.0%
plugins/csp-recorder/src/Plugin.cpp 0 5 0.0%
<!-- Total: 0 1375 0.0% -->
Files with Coverage Reduction New Missed Lines %
plugins/csp-anchor-labels/src/AnchorLabel.cpp 1 0%
plugins/csp-atmospheres/src/Atmosphere.cpp 1 0%
plugins/csp-custom-web-ui/src/Plugin.hpp 1 0%
plugins/csp-fly-to-locations/src/Plugin.cpp 1 0%
plugins/csp-lod-bodies/src/LodBody.cpp 1 0%
plugins/csp-lod-bodies/src/PlanetShader.cpp 1 0%
plugins/csp-measurement-tools/src/Plugin.cpp 1 0%
plugins/csp-minimap/src/Plugin.cpp 1 0%
plugins/csp-rings/src/Ring.cpp 1 0%
plugins/csp-satellites/src/Plugin.cpp 1 0%
<!-- Total: 95 -->
Totals Coverage Status
Change from base Build 2696156115: 0.02%
Covered Lines: 491
Relevant Lines: 16305

💛 - Coveralls
Schneegans commented 2 years ago

A tip for testing this: The DLR-internal configuration repository also contains a feature/refactor-celestial-anchors branch with updated configuration files.

JonasGilg commented 1 year ago

The csp-satellites plugin throws the following OpenGL errors:

[I] csp-satellites .... Loading plugin...
[W] cs-graphics ....... From vista-gltf: OpenGL error in "createGPUsampler": 1280 (1280) C:/C++/cs-gh/src/cs-graphics/internal/gltfmodel.cpp:916
[W] cs-graphics ....... From vista-gltf: OpenGL error in "createGPUsampler": 1280 (1280) C:/C++/cs-gh/src/cs-graphics/internal/gltfmodel.cpp:916
[W] cs-graphics ....... From vista-gltf: OpenGL error in "createGPUsampler": 1280 (1280) C:/C++/cs-gh/src/cs-graphics/internal/gltfmodel.cpp:916
[I] csp-satellites .... Loading done.
Schneegans commented 1 year ago

The csp-satellites plugin throws the following OpenGL errors:

[I] csp-satellites .... Loading plugin...
[W] cs-graphics ....... From vista-gltf: OpenGL error in "createGPUsampler": 1280 (1280) C:/C++/cs-gh/src/cs-graphics/internal/gltfmodel.cpp:916
[W] cs-graphics ....... From vista-gltf: OpenGL error in "createGPUsampler": 1280 (1280) C:/C++/cs-gh/src/cs-graphics/internal/gltfmodel.cpp:916
[W] cs-graphics ....... From vista-gltf: OpenGL error in "createGPUsampler": 1280 (1280) C:/C++/cs-gh/src/cs-graphics/internal/gltfmodel.cpp:916
[I] csp-satellites .... Loading done.

This is true, but it should be a separate issue, as it also happens on the current develop branch.