32-Bit Word-Packed 3D Mathematical Morphology & Open-Face Indirect Emission
Stores a binary 3D voxel volume at 1 bit per cell inside 32-bit GPU words, running bitwise erosion and dilation in compute shaders and emitting only exposed boundary faces via indirect draw buffers.
Also known as bit-packed 3D morphology, word-packed voxel erosion, bitmask voxel sculpting
In the family Geometry, meshing & signed distance fields, voxel morphology & meshing
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | None found | |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Binary 3D mathematical morphology—erosion, dilation, opening, and closing—normally stalls on memory bandwidth when stored at one byte or float per voxel. Packing 32 consecutive cells along X into a single uint32 cuts storage and memory traffic by 32×, allowing grids of 256³ to 472³ voxels to reside comfortably in a few megabytes of GPU storage buffers.
Each compute pass reads a destination word together with its neighbor words across the structuring element's footprint (such as a 6-connected cross or spherical brush). Along the packed axis, shifted neighbor bits are assembled in registers via bitwise shifts and masks ((curr >> 1) | (next << 31)), so erosion reduces to bitwise AND over the neighborhood while dilation reduces to bitwise OR—updating 32 voxels per word operation.
For rendering without full-volume ray marching or CPU readbacks, a second compute pass computes the 6 open-face bitmasks per word (solid & ~neighbor_solid) along ±X, ±Y, ±Z. Threads iterate over set bits with count-trailing-zeros (ctz) and atomically append exposed quad coordinates to a flat face buffer, writing the exact vertex count into an indirect draw argument buffer for a single instanced GPU draw call.
When to choose it
Reach for it when
- 3d voxel erosion or dilation uses too much vram and bandwidth
- need fast gpu morphological opening closing or smoothing on voxel masks
- pack 64 binary voxels per word for single-instruction neighbor stencils
- sculpt and clean up noisy voxel occupancy grids at interactive rates
- compute bitwise 3d flood fill and bevel masks in compute shaders
Choose it when you need interactive sculpting, real-time morphological erosion/growth, or destruction on high-resolution dense binary voxel grids on compute-capable GPUs.
Prefer Greedy meshing for voxel worlds when chunks are mostly static and minimizing triangle count for rasterization matters more than per-frame rebuild speed. Prefer NanoVDB when the volume is huge and sparse or needs floating-point densities rather than binary occupancy. Prefer Marching Cubes when you want smooth isosurfaces instead of crisp cubical voxel faces.
Field marks
- Fixed dense 3D allocation scales cubically with resolution, limiting maximum world extent compared to sparse trees
- Repeated erosion followed by dilation (morphological opening) permanently rounds corners and deletes thin tendrils smaller than the structuring element
- Worst-case porous or checkerboard volumes can overflow fixed-capacity indirect face buffers if no budget cap or multi-pass compaction is enforced
- Binary occupancy stores no sub-voxel surface normals, requiring screen-space shading, AO, or dual-grid smoothing to avoid stair-stepped lighting
Crosses
- GPU-driven rendering: Indirect draw arguments populated by the open-face emitter let the GPU render dynamically changing face counts without CPU synchronization.
- Greedy meshing for voxel worlds: Coplanar exposed faces from stable regions can be merged into larger quads to reduce rasterization overhead.
Sources
- primaryDaniel Oliveira Dantas, Helton Danilo Passos Leal (2019). Fast multidimensional binary image processing with OpenCL. 2019 International Conference on High Performance Computing & Simulation (HPCS).Verified via doi.org · 2026-11-30doi:10.1109/hpcs48598.2019.9188210
- implementationacher249 (2026). acher249/codevember-2026. #codevemberGitHub API · license MIT · 2026-11-30