Skip to content
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

Implement derived content caching #990

Draft
wants to merge 9 commits into
base: ue4-main
Choose a base branch
from
Draft

Conversation

nithinp7
Copy link
Contributor

@nithinp7 nithinp7 commented Oct 28, 2022

Builds on top of CesiumGS/cesium-native#569 (see that PR for more details)

This is the simplest implementation of derived content caching, we simply serialize / deserialize the in-memory gltfs along with all the buffers. Currently this lets us skip all the Cesium Native loading, but we still have to go through the Cesium for Unreal loading. Before merging we plan to:

  • Serialize / deserialize cooked physics meshes into the derived content cache (as of writing this physics cooking is the biggest remaining load cost).
  • Serialize the glTF after CreateOffGameThread(..) - since the loading process may mutate the in-memory glTF, e.g., generate mipmaps.
  • Use LZ compression on the bulk data before writing to disk, to save a bit of disk-space? From offline discussion we are not sure how big of a performance / memory win this will be though.
  • Finalize a future-proof archive format that can be versioned and properly invalidated when settings change.

Still a good bit of work to do here, but so far this is a good show-case implementation of the Cesium Native changes.

Some preliminary results:
In the below picture, the load tasks containing the big yellow task (physics cooking) are cache misses (fresh response data from the network with no derived cache content). The super fast ones are cache hits. The load time difference (per tile) is already incredible, a rough average improvement might be ~400ms down to ~40ms for a tile's load work. The overall apparent load time seems improved as well, but may still be slightly bottlenecked by the sqlite reader thread pool (we can experiment with increasing the number of threads there).

CachedPhysics

@cesium-concierge
Copy link

Thanks for the pull request @nithinp7!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants