WebGPU 融球
WebGPU Metaballs,Brandon Jones (toji),2021 年

正在布展…
它是怎么做的
- 第 1 步融球场值在 3D 网格上用计算着色器求和
- 第 2 步Marching Cubes 在 GPU 上生成三角形并写入间接绘制缓冲
- 第 3 步可切换场景(熔岩灯、地牢)与点光源
- 第 4 步间接绘制避免 CPU 回读顶点数
复刻配方
一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。
Evaluate a scalar field (sum of r^2/d^2 for moving balls) on a 3D voxel grid in a WebGPU compute shader. Run a second compute pass implementing marching cubes with lookup tables in storage buffers, appending triangles via an atomic counter. Write the vertex count into an indirect draw buffer and render with drawIndirect so the CPU never reads back geometry. Animate ball centers with sine motion and shade with a few point lights.


