Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

greedy_mesh

Turns a voxel chunk into a mesh, merging coplanar faces of one colour into the largest rectangle that covers them so a solid wall costs two triangles instead of two per voxel. One invocation per slice; the vertex and index counts are claimed atomically, so the pass writes both buffers in a single dispatch.

Bindings

namekindwhat it is
paramsbuffer (read, u32)chunk size, padding and the origin the mesh is built around
solid_paddedbuffer (read, u32)the chunk's occupancy bitmask, one voxel of padding on every side so a face test at the edge reads a real neighbour
colorsbuffer (read, u32)one packed colour per voxel
vertex_bufbuffer (read_write, u32)the vertices produced, in the engine's vertex layout
index_bufbuffer (read_write, u32)the indices produced
countersbuffer (read_write, atomic u32)how many vertices and indices have been claimed

Params

nametypewhat it is
vertStrideu32one vertex in u32 words, so the writes follow the engine's vertex layout