Skip to content

Cubic Chunks → Column Chunks#75

Merged
cb341 merged 15 commits intomainfrom
feature/column-chunks
Feb 15, 2026
Merged

Cubic Chunks → Column Chunks#75
cb341 merged 15 commits intomainfrom
feature/column-chunks

Conversation

@cb341
Copy link
Owner

@cb341 cb341 commented Feb 15, 2026

After some consideration, I have come to the realization that CubicChunks are probably not the best way forward for rsmc. I don't plan on generating vertically infinite terrain anyways.

Some ideas

Pros

  • ColumnChunks lead to fewer meshes → fewer drawcalls → higher fps
  • ColumnChunks buffers are more contiguous, which could yield better compression performance
  • ColumnChunks allow speedup in TerrainGeneration as I can use a HeightMap before sampling Noise
  • Potential for subchunks → skipping parts of chunks for storage, meshing
  • Theoretically better greedy meshing potential
  • Much easier handling of Gravity Blocks
  • More control over terrain generation such as surface level
  • Cheap lighting calculations
  • Fewer ChunkManager keys
  • Fewer synchronization tasks
  • Fewer neighbors to keep track of → Simpler implementation of complex generation, such as structures in the future

Cons

  • Coordinates are no longer symetrical (IVec3 → ChunkPosition, i32)
  • No more vertically infinite terrain
  • Potentially more booring caves
  • Slower meshing
  • Larger meshes
  • Slower initial world load (as we need to stream more than just the "subchunk" the player is in)

@cb341 cb341 self-assigned this Feb 15, 2026
let task_pool = AsyncComputeTaskPool::get();
let chunk = *chunk;
let texture_manager = texture_manager.clone();
let chunk = chunk.clone();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can no longer copy chunks.
Storing them on stack yields StackOverflow errors as the memory requirements are too large, hence the heap.

assert!(x < n && y < h && z < n, "Index out of bounds: ({}, {}, {})", x,y,z);

x + n * (y + n * z)
z + n * (y + h * x)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This aims to improve cache locality.
We usually iterate in order x,y,z.
This way z is the most frequently changing variable.

z,y,x order over x,y,z should improve performance.
I didn't look into it too deeply.

Copy link
Owner Author

@cb341 cb341 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cb341 cb341 marked this pull request as ready for review February 15, 2026 12:39
@cb341 cb341 merged commit a510634 into main Feb 15, 2026
2 checks passed
@cb341 cb341 deleted the feature/column-chunks branch February 15, 2026 15:34
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.

1 participant

Comments