Skip to main content

Module gpu_marching_cubes

Module gpu_marching_cubes 

Source
Expand description

GPU-accelerated marching cubes via compute shaders.

Three-pass pipeline:

  1. Evaluate field at every grid point → 3D texture
  2. Classify cells, compute vertex counts, prefix sum
  3. Generate vertices using tri table → SSBO, draw via indirect

Performance target: 32³ grid in under 1ms on modern GPU.

Structs§

FieldEvalUniforms
Uniform buffer for the field evaluation pass.
GpuFieldSource
Uniform buffer data for field source uploads. Sent to the GPU each frame as a small uniform/SSBO.
GpuMCStats
Per-frame GPU marching cubes statistics.
GpuMarchingCubes
GPU marching cubes pipeline state.

Constants§

CLASSIFY_COMPUTE
Pass 2: Classify cells and count vertices.
FIELD_EVAL_COMPUTE
Pass 1: Evaluate field at every grid point.
VERTEX_GEN_COMPUTE
Pass 3: Generate vertices.