pub struct MipUpload {
pub vsid: u32,
pub cz: u32,
pub occ_words_per_col: u32,
pub occupancy: Vec<u32>,
pub solid_occupancy: Vec<u32>,
pub color_offsets: Vec<u32>,
pub colors: Vec<u32>,
}Expand description
GPU.11 — one mip level of a chunk in the GPU upload shape. Mip-N
has (vsid >> mip)² columns spanning z = 0..CHUNK_Z >> mip.
color_offsets are absolute within the chunk’s whole colour
block (cumulative across mips): mip-0’s run [0..n0], mip-1’s
run [n0..n0+n1], etc. So colors of all mips concatenated in
level order index directly via chunk_colors_base + offset + rank — the same formula the shader already uses for mip-0,
independent of which mip is being read.
Fields§
§vsid: u32XY column extent at this mip = vsid >> mip.
cz: u32Z-extent at this mip = CHUNK_Z >> mip.
occ_words_per_col: u32Occupancy words per column at this mip = cz.div_ceil(32).
occupancy: Vec<u32>vsid² * occ_words_per_col packed textured occupancy bits
(one set bit per voxel that has an explicit colour). The shader
rank-counts these for the colour lookup.
solid_occupancy: Vec<u32>Same shape as occupancy, but one set bit per solid voxel
— textured surfaces and the implicit bedrock interior below
them. The marcher hit-tests against this so vertical
wall/cliff faces are opaque; bedrock hits inherit the colour of
the textured surface above them. (Fixes the “cliff face shows
sky” bedrock-as-air artifact.)
color_offsets: Vec<u32>vsid² + 1 cumulative-within-chunk colour offsets.
colors: Vec<u32>This mip’s packed BGRA colours (ascending z within a column,
columns in x + y*vsid order).