WebGL + WebASM Marching Cubes

Volume:
Colormap:

Isosurface info:

Controls

Desktop: Left-click + drag to rotate, scroll to zoom, right-click + drag to pan.
Touch: One finger drag to rotate, pinch to zoom, two finger drag to pan.

Description

This is a WebGL + WebASM implementation of the classic Marching Cubes algorithm for extracting isosurfaces from 3D volume data. An isosurface is a surface which represents points in the 3D data which all have the same value (e.g., pressure, temperature). Try changing the slider to change the selected isovalue! The isosurface extraction code is implemented in Rust and compiled to WebAssembly to accelerate extraction of the surface. Depending on your browser, when compared to the pure Javascript version the WebASM version is 10-50x faster! You can run the Javascript version by unchecking the "Use WebASM" box. The surface is rendered as a triangle mesh and combined with the volume during the volume raycasting step, in a manner roughly similar to shadow mapping. Get the code on GitHub!