2. What the reference actually does

7 Days to Die as a structural reference — and this repo's own prior attempt at it, which is the case study with actual evidence behind it.

Confidence

The first section is reverse-engineered community knowledge, not documented internals. Treat the broad structure as likely and the specifics as plausible. Since parity is now the explicit target (D3), anything here that turns out to be wrong changes the target — so these are claims to verify against the game, not facts to build on blindly. The second section, drawn from this repo's git history, is fact.

The structure, as far as it is knowable

One grid, two representations, never blended.

The lesson that actually transfers

Key insight

The reference never tries to make its smooth terrain surface meet a block face cleanly. The two representations interpenetrate. Terrain marches past the wall, the block is drawn on top, and nobody notices.

This matters because Epic #24 in this repo was a war fought over exactly that junction — a junction the reference does not attempt to solve. Reading the history back:

CommitAttemptOutcome
bc959a1Fix see-through cracks at the junctionPartial
2095e3eAdd terrain skirts at construction boundariesReverted by b80c502
f91c69fSnap terrain boundary vertices onto adjacent construction facesSuperseded
bb4db56Extend snapping to corners and edgesSuperseded
4774aadExtend snapping to inner (concave) cornersSuperseded
4656681Replace snapping with a watertight "seal + natural" seamThen the whole isosurface path was deleted in the same commit

Five successive attempts at one junction, one revert mid-stream, and a final solution landed and discarded in the same commit. That is the strongest available evidence about where the difficulty in this project actually is — and it is not in the isosurface algorithm, which worked. It is in making two representations share a boundary.

The prescription for the second attempt follows directly: do not share the boundary. Mesh terrain with construction cells reading as full density so the surface closes against them, draw the cubes over the top, and accept interpenetration. No skirts, no vertex snapping, no watertight junction.

What the final commit says it landed on

Worth quoting from 4656681, because it had arrived close to the reference design immediately before the whole path was cut:

Replace the terrain isosurface's "skip + snap" seam handling with "seal + natural": the surface is now watertight across the junction (no dropped quads = no see-through holes at sharp edges), while construction stays crisp via the existing cube mesher/pipeline drawn on top. […] Remove the vertex-snapping onto cube faces entirely (the flat/coincident look that was rejected).

"Watertight base surface, crisp cubes drawn over the top, no snapping" is essentially the reference architecture. The one mechanism it did not adopt is the cheaper one: letting the two simply interpenetrate, without sealing the terrain surface across the junction at all.

What survived the deletion

The data model was left deliberately intact, which materially lowers the cost of the second attempt:

What did not survive: SurfaceNetsMesher.{h,cpp}, the triplanar terrain.{vert,frag} shaders, the terrain texture array and its art, the density brush edit ops, and roughly 500 lines of tests. Of these, only the brush is genuinely obsolete — D5 replaces it with per-cell density reduction.