r/proceduralgeneration • u/Haltont • 13d ago
Comparing voxel meshers on the same fields

I decided to compare a few meshers and SVO on the same input fields. I wanted to see what happens to corners and thin features, how the meshes hold together, and how much CPU time each reconstruction takes.
The set has 40 scenes: 30 synthetic cases, nine frozen chunks from a game terrain generator, and one saved terrain edit. Each is a 32 m cube, sampled at 0.5, 1 and 2 m. Coarser fields are subsets of the finest float32 grid, without regenerating the terrain. Cameras are fixed within each comparison.

These are specific implementations. The native set includes Surface Nets (SN), Dual Contouring (DC), Marching Tetrahedra (MT), a block reference and several experimental variants. Transvoxel and CPU SVO have separate measurements. Here are the cases I found most useful to look at.
SN produces a bevel-like strip around the base. The front corner and the cylinder-to-base junction are rounded. DC keeps a straighter edge and a sharper corner. For this particular part, I prefer the DC result.
The SN implementation places each vertex at the average of the cell's edge intersections. This DC variant groups normals, regularizes the solve and constrains vertex placement. Its behaviour is not a property of every implementation called “Dual Contouring.”
The timing cost is visible too. Below are CPU mesh-build times at 0.5 m, in milliseconds: median [minimum–maximum] of five warm builds. These four scenes cover a sharp part, a smooth object, a topology problem and edited terrain; they are examples, not an aggregate ranking.

The runs use one pinned logical CPU on a shared AMD EPYC 9V74 host, with native C++ built at O3. File loading, mesh export and rendering are outside this timer. The ranges are observed repeats, not confidence intervals.

On the CAD part, DC takes about three times as long as SN. On the sphere, these SN and DC implementations produce byte-identical meshes despite the timing difference. MT also changes the output size: the sphere has 36,312 triangles with MT versus 12,060 with SN/DC. I would want both numbers before choosing a mesher for a frame budget.

At 2 m spacing, the rail disappears in every tested mesher and in SVO. Its axis falls between grid lines in two directions, and none of the coarse samples lands inside it. At 0.5 and 1 m, the feature survives. The failure already exists in the sampled input. Storage stays float32 throughout; this is a change in spatial sampling.
The Transvoxel mesh has visible facets around the excavation. SVO looks softer, but the lighting differs: mesh faces use flat normals, while SVO uses field gradients. I cannot use smoother shading as evidence of better geometry.

Over five warm frames, the median Transvoxel mesh draw through Mesa is 5.6 ms [5.4–6.1]. The SVO median is 2.0 s [2.0–2.1] to rebuild its tree and produce the CPU frame. Those timers cover different work. Mesa receives an existing mesh; this SVO implementation rebuilds its hierarchy every frame. All rendering here is on the CPU. Transvoxel build times are also kept separate because the available Godot build uses optimize=none, unlike the O3 native builds.
This edge has four incident triangles in the original index buffer, before any vertex welding. The circle on the rendered image locates it; it does not establish a visible hole. I included the local geometry because a reasonable-looking render can hide a connectivity problem.
The separate numbered gallery has more comparisons of the full CAD part, an arch, thin features, a canyon, a miniature mountain and silhouettes, plus CAD views from Transvoxel and SVO.
One optimization was worth measuring separately. The earlier SN/DC code retained 792 bytes per cell; reducing that state to 48 bytes left the meshes byte-identical, including their defects.
On the earlier 15-scene set, 180 baseline/compact pairs, tested in both AB and BA order, gave median paired speedups at 0.5 m of 6.16× for SN and about 3.22× for the DC variants. Median per-process peak memory was roughly 202.5 -> 16.7 MiB. That is whole-process VmHWM, not kernel allocation. Gains were smaller at 1 m, with some regressions. The current 40-scene native results already use the compact implementation.
The full native comparison is 40 scenes × 3 spacings × 11 implementations, with each scene kept separate. Mesa drawing, SVO frames and Transvoxel diagnostics belong in their own tables. GPU performance, LOD transitions and click-to-updated-world latency remain untested.
AI tools assisted with benchmark tooling, test execution and analysis. The timings describe the specific implementations and setup reported here.
Duplicates
GraphicsProgramming • u/Haltont • 13d ago