Coarse-to-Fine SDF
- A dense grid is mostly waste
- A signed distance function (SDF) returns, for any point, the distance to the nearest surface, signed negative inside the shape and positive outside. The surface itself is the zero level set. Every figure below draws inside points red and outside points blue
- To extract a mesh, sample the function on an \(R \times R \times R\) grid of points, which bounds \((R-1)^3\) cells, and run marching cubes, which emits triangles in every cell whose corner signs differ. Cost is counted in points; refinement acts on cells
-
A sign change means two corners \(p_0\) and \(p_1\) lie on opposite sides, so the surface crosses the edge between them. Take a point on that edge as \(p(t) = p_0 + t(p_1 - p_0)\), assume the field varies linearly along it, \(v(t) = v_0 + t(v_1 - v_0)\), and solve for the zero:
\[ 0 = v_0 + t(v_1 - v_0) \quad \Longrightarrow \quad t = \frac{v_0}{v_0 - v_1} \]The same \(t\) is solved from the two values and then spent on the position, \(p_0 + t(p_1 - p_0)\). The vertex therefore lands nearer the corner whose value is closer to zero, rather than at the midpoint
-
The grid decides the cost: \(R = 128\) is
2,097,152queries, and doubling \(R\) multiplies that by eight. When the SDF is a neural decoder, those queries dominate the whole reconstruction - A surface is 2D inside a 3D grid. Cost grows like \(R^3\), but the answer lives on \(O(R^2)\) cells, so almost every query reports empty space
- Refine only near the surface
- Start on a coarse grid and, at each finer level, evaluate only the cells the surface could pass through. The figure below runs the ladder \(4 \rightarrow 8 \rightarrow 16 \rightarrow 32 \rightarrow 64\) cells per axis
-
Only the coarsest level is ever sampled in full — all
125points of the \(4^3\) grid. Every level after it sees just the corners of the cells its parent kept -
Across the five levels that comes to
53,322points, where sampling the finest grid in full would take \(65^3 =\)274,625. The mesh it produces is identical to the dense one, vertex for vertex, at 14,706 triangles - What about the points nobody sampled? They inherit the value from the level above, so the grid stays complete and marching cubes runs on it unchanged