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

Feature/117 pre cache meshes #146

Closed
wants to merge 60 commits into from
Closed

Conversation

JaXt0r
Copy link
Contributor

@JaXt0r JaXt0r commented Oct 1, 2024

Description

TBD

To test

Out-of-Scope

…ring works. (Hint: glTF won't cache Colliders)
…o added VirtualObjectType.Vob as cacheable element.
… loading. We skip it for now and added more ErrorLogs if something like this happens.
…during PreCaching stage. (Simply ignoring all Prefabs and only loading Gothic data)
…during PreCaching stage. (Simply ignoring all Prefabs and only loading Gothic data)added: Found a smart way to ignore Prefab GO+Component instantiation during PreCaching stage. (Simply ignoring all Prefabs and only loading Gothic data)
…tation as they differ between VobCache and Vob creation times.
…ring World loading (World mesh data at least)
…stractMeshBuilder as moved to TextureArrayManager
# Conflicts:
#	Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs
…hort lived temp dictionary for Texture2DArray creation only.
JaXt0r added 26 commits October 1, 2024 06:31
…Also deleted GltManager and moved logic to StaticCacheManager already earlier.
…all caches before (1) creating a new one, (2) loading more data without cache where we don't need the caches from StaticCache any longer.
… then cache will be recreated automatically.
…ize by additional ~60% and loading times by additional ~30%.
…s which took the time before) and dynamize yield for async loading for World+Vobs+Npc
…- apply prefab elements to VOB GO structures from StaticCache.
…disabled while loading. Colliders of World chunks are missing though.
@JaXt0r
Copy link
Contributor Author

JaXt0r commented Oct 4, 2024

Some updates on the PreCaching logic:

  • We save 2 seconds of loading time compared to previous logic of loading. 😕
  • I can still optimize Phase 2 a little, but I don't expect huge frame benefits

This is the data for now:

old logic without cache

  • 26s/27s - full world + VObs loading - (but unoptimized for fps - aka there are hickups and if optimized it would take about 30-35 I assume)

new logic with cache

  • 24/25 - full world + VOB loading
  • -> 7s - Phase 1 - Cache loading from file and apply Meshes to scene
  • -> 12s - Phase 2 - Apply prefab to cached VOB meshes - Prefabs applied to 11.286 VOBs
  • -> 6s - Phase 3 - Create dynamic/non-meshed VOBs - created new VOBs 3.267

Some points against current solution:

  • The most loading time consuming tasks are the application of GameObject components and hierarchies from Pre-cached VOBs and the Prefabs. This is heavily used already and consumes most of the time as we apply it to 11k objects when loaded.
  • Precaching VOBs is a huge complexity addition where we now have 3 required phases of Component additions to VOBs
  • The more we put into the cache, the more likely we will miss to keep track of when a cache needs to be altered or not. (Cache version flag)
  • Loading fifteen thousand objects when we will see only a handful of them during game sessions feels so wrong

Next steps:

  • The Branch behind this PR can be referenced for a couple of weeks if needed
  • A possibility could be to only cache TextureArray information and Meshes. No VOB object structure, but instead applying the meshes at the time of world loading.
  • Some smaller improvements (like disabling meshes during loading time) are currently adopted to main Feature/75 async loading based on device refresh rate #154

@JaXt0r JaXt0r closed this Oct 4, 2024
@JaXt0r JaXt0r deleted the feature/117-pre-cache-meshes branch October 4, 2024 13:36
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.

Cache world mesh + static VOB mesh to be calculated only once
1 participant