File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -805,10 +805,12 @@ pub const ChunkManager = struct {
805805 // Apply the new mesh
806806 render_chunk_ptr .setMesh (result .mesh );
807807
808- // A neighbor arrived while this chunk was being meshed — the mesh we just
809- // applied may have stale boundary faces. Queue a follow-up remesh now that
810- // the chunk is in .ready state (setMesh transitions to .ready).
811- if (render_chunk_ptr .needs_remesh .swap (false , .acq_rel )) {
808+ // Initial mesh (gen 0) was generated on the worker before the RenderChunk
809+ // existed in storage. Neighbors generated concurrently couldn't see this chunk,
810+ // and this chunk's mesh may not have seen them. Always follow up with a remesh
811+ // to capture all currently-loaded neighbors and fix boundary face culling.
812+ // For subsequent meshes (gen > 0), only remesh if a neighbor arrived during meshing.
813+ if (result .mesh_generation == 0 or render_chunk_ptr .needs_remesh .swap (false , .acq_rel )) {
812814 self .queueChunkRemesh (result .pos );
813815 }
814816
You can’t perform that action at this time.
0 commit comments