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.
Currently,
ChunkedSpaceMesh
will keep meshes for exactly and only the blocks currently in theSpace
's block palette. This is sometimes inefficient because a block might disappear and reappear; additionally, the same block might appear in multipleSpace
s, 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:
MeshJobQueue
background computation