Builtin Library
- ..
- .metadata17 B
- README.md637 B
- bindings.yaml219 B
- shader.wgsl3.4 KB
README.md
compute_voxelize
Voxelizes a triangle mesh on the GPU. For each grid cell it casts a ray along +X and counts Möller–Trumbore triangle intersections — an odd count means the cell is inside the mesh.
Bindings (see bindings.yaml): triangles (read array<f32>, 15 floats/triangle),
params (read array<f32> — [minXYZ, maxXYZ, resXYZ, voxelSize, triCount, 0]),
output (read_write array<f32>, one per cell: 1.0 = occupied, 0.0 = empty).
Usage: dispatch by identity with compute.dispatch("@builtin::shaders.compute_voxelize", ...) —
it resolves to the shader's stable guid and auto-compiles on first use (no setup).