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

Block mesh caching #494

Open
kpreid opened this issue May 25, 2024 · 0 comments
Open

Block mesh caching #494

kpreid opened this issue May 25, 2024 · 0 comments
Labels
kind: performance Ways to increase performance or efficiency without adding functionality

Comments

@kpreid
Copy link
Owner

kpreid commented May 25, 2024

Currently, ChunkedSpaceMesh will keep meshes for exactly and only the blocks currently in the Space's block palette. This is sometimes inefficient because a block might disappear and reappear; additionally, the same block might appear in multiple Spaces, such as in the UI, so computing it again is wasteful and also a visible glitch sometimes.

Therefore, we should cache block meshes that aren't currently visible — and possibly even some that are not yet visible. This is not hard in principle, but has some details:

  • Integration with MeshJobQueue background computation
  • Cache size and eviction policy (since we are now storing more data than strictly necessary for rendering)
  • Efficiently looking up the right cache keys, without spending too much time comparing voxels.
@kpreid kpreid added the kind: performance Ways to increase performance or efficiency without adding functionality label May 25, 2024
kpreid added a commit that referenced this issue May 25, 2024
This is part of work towards mesh caching:
<#494>
kpreid added a commit that referenced this issue May 25, 2024
See <#494> for context.
The cache is not yet used but I believe having this small amount of dead
code will be better overall for development than having yet another
unmerged branch. (Unless the cache never happens or looks totally
different than this, of course.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: performance Ways to increase performance or efficiency without adding functionality
Projects
None yet
Development

No branches or pull requests

1 participant