|
← 判断力与美学 ← Judgment & Aesthetics
SAE 判断力与美学 · 余项之美
SAE Judgment & Aesthetics · Beauty of the Remainder
2026-06-02

SDF Editor:当曲面只是距离函数的零点余项

SDF Editor: When the Surface Is Just the Zero-Crossing Remainder of a Distance Function

Han Qin (秦汉)

在三维建模的整个历史中,曲面是被显式地定义的。从多边形网格的每个顶点、每条边、每个面,到NURBS的控制点和权重,「存储曲面」是一件你主动去做的事。曲面是构(construct)——是建模工具的核心输出物。Johan Holwerda在RenderQueue上发布的WebGPU SDF Editor做了一件根本不同的事:它从不存储任何曲面。它存储的是距离函数——对空间中每一个点,回答「你离最近的表面有多远?」的连续数学函数。曲面本身只是这个函数的零点交叉(zero-crossing),是一个被计算出来的副产品,一个数学推导的余项。

这个架构上的翻转产生了连锁反应。因为曲面从未被储存,所以必须每一帧都重新提取——通过Marching Cubes或Surface Nets算法,将连续函数的零点位置逼近为离散的点或三角形。这意味着你看到的每一个表面都是即时计算的沉积物,而非先验的定义。更深一层:Holwerda的渲染器甚至抛弃了三角形。Surface Nets提取出的顶点被直接渲染为像素大小的点——因为在2^32个网格单元的空间里,找到相邻顶点来构成三角形所需的查找表将达到40亿条目,内存不允许。点云是三角形构被内存约束凿去之后的余项。而时间反锯齿(TAA)通过在帧之间混合亚像素偏移的结果来填补点之间的缝隙——最终图像是点在时间中积累的余项。

凿构循环在这个编辑器中呈现为至少三重结构。第一重:多边形建模是三维造型的构,SDF凿去了显式几何表示,留下的余项是纯粹的数学距离——表面不被拥有,只被暗示。第二重:三角形渲染是实时图形的构,内存约束凿去了三角形索引,留下的余项是孤立的点——点云美学不是设计选择,而是约束的强制结果。第三重:WebGPU本身是浏览器安全模型凿去原生GPU访问后的余项——空间分区、八叉树分裂、行进立方体、1024方向环境遮蔽阴影贴图,全部作为compute shader在浏览器标签页中运行,每一步都在与沙箱边界博弈。

命名间隙宽阔得几乎滑稽。它是CAD工具吗?(没有工程约束,没有制造导出,没有参数化历史。)是雕塑软件吗?(没有笔刷,没有黏土隐喻,没有细分曲面。)是Shader玩具吗?(它有完整的层级场景图,支持群组和布尔运算。)是数学可视化器吗?(它生产实际的三维物体,你可以旋转、缩放、用光照渲染。)是游戏引擎组件吗?(没有物理,没有脚本,没有游戏循环。)五个命名体系同时失效。它活在Reinder Nijhoff的RenderQueue实验平台上——一个荷兰创意程序员的个人实验场——作为一篇客座贡献存在。一个人的实验,既不是论文也不是产品,既不是演示也不是工具。逻辑仍在生长。

renderqueue.dev/sdf-editor ↗

Throughout the history of 3D modeling, surfaces have been defined explicitly. From each vertex, edge, and face of a polygon mesh to the control points and weights of a NURBS curve, "storing the surface" is something you actively do. The surface is the construct — the core output of the modeling tool. Johan Holwerda's WebGPU SDF Editor, published on Reinder Nijhoff's RenderQueue, does something fundamentally different: it never stores any surface at all. What it stores are distance functions — continuous mathematical functions that, for every point in space, answer the question "how far are you from the nearest surface?" The surface itself is merely the zero-crossing of this function, a byproduct of computation, a remainder of mathematical derivation.

This architectural inversion cascades. Because the surface is never stored, it must be re-extracted every frame — through Marching Cubes or Surface Nets algorithms that approximate the zero-crossings of the continuous function into discrete points or triangles. Every surface you see is the sediment of real-time computation, not a prior definition. Deeper still: Holwerda's renderer abandons even triangles. Surface Nets vertices are rendered directly as pixel-sized points — because in a space of 2^32 grid cells, the lookup table needed to find neighboring vertices for triangle construction would require 4 billion entries, which exceeds available memory. The point cloud is what remains when the triangle construct is chiseled away by memory constraints. And temporal anti-aliasing (TAA) fills the gaps between points by blending sub-pixel-jittered results across frames — the final image is the temporal remainder of point accumulation over time.

The chisel-construct cycle manifests here in at least three layers. First: polygon modeling is the construct of 3D form-making; SDF chisels away explicit geometric representation, leaving pure mathematical distance as the remainder — the surface is never owned, only implied. Second: triangle rendering is the construct of real-time graphics; memory constraints chisel away triangle indices, leaving isolated points as the remainder — point-cloud aesthetics are not a design choice but a forced consequence of constraint. Third: WebGPU itself is the remainder of the browser's security model chiseling away native GPU access — spatial partitioning, octree splitting, marching cubes, 1024-direction ambient occlusion shadow maps, all running as compute shaders in a browser tab, each step negotiating with sandbox boundaries.

The naming gap is almost comically wide. Is it a CAD tool? (No engineering constraints, no manufacturing export, no parametric history.) A sculpting app? (No brushes, no clay metaphor, no subdivision surfaces.) A shader toy? (It has a full hierarchical scene graph with groups and boolean operations.) A math visualizer? (It produces actual 3D objects you can rotate, scale, and light.) A game engine component? (No physics, no scripting, no game loop.) Five naming systems fail simultaneously. It lives on Reinder Nijhoff's RenderQueue — an experimental rendering playground by a Dutch creative coder — as a guest contribution. One person's experiment, neither paper nor product, neither demo nor tool. The logic is still growing.

renderqueue.dev/sdf-editor ↗