Avokadoen / zig_vulkan

Toying with vulkan and zig
48 stars 2 forks source link

Leaf node should be index in a normal NxNxN grid #76

Closed Avokadoen closed 2 years ago

Avokadoen commented 2 years ago

instead of leaf nodes being voxel, they should be indices to a NxNxN collection of voxels.

A N value of 4 is probably a good mix between big enough while still not consuming too much extra memory, but it will have to be benchmarked https://dspace.library.uu.nl/handle/1874/315917

Pros

Cons:

suggested structures:

glsl

struct Chunk {
 // each voxel is a 8bit uint which is the voxel's material index
 [4][4]uint row
}

Zig

const Chunk = packed struct {
  row: [4][4]packed struct{
    x: u8,
    y: u8,
    z: u8,
    w: u8,
  }
}
Avokadoen commented 2 years ago

Resolve by porting to brickmap