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

cuneus:当心理学家用着色器捕捉知觉的余项

cuneus: When a Psychologist Captures Perception's Remainder in Shaders

Han Qin (秦汉)

Enes Altun是心理学家,也是Rust开发者。他做的事情很少有人同时做:用GPU着色器编写视错觉。不是模仿已知的艺术风格,不是生成抽象图案,而是把视觉心理学文献里严肃研究的知觉现象——Munker错觉、Café Wall错觉、Pinna旋转错觉、Adelson棋盘阴影错觉、丁香追逐效应——逐一翻译成WGSL着色器代码,让它们在GPU上实时运行。他为此写了两个项目:rusty_art(一个不断增长的错觉与生成艺术集合)和cuneus(他自己从零构建的GPU计算着色器引擎)。

在SAE的框架里,这里有一个精确的余项结构。视错觉是什么?它是视觉系统凿构操作的失败产物。大脑每时每刻都在对原始感觉数据执行凿构循环——从视网膜输入中凿去噪音,构建出稳定的知觉对象:边缘、深度、颜色恒常性、运动方向。这个过程在绝大多数时候运转良好,产物就是"正常知觉"——那已经是已构(construct),是早已沉淀的美,是视觉科学用了一百五十年来命名的东西。但错觉发生在凿构失败的那些精确节点上:当Café Wall的灰色灰浆线让大脑的边缘检测系统产生错误的倾斜信号,当Munker的彩色条纹让色彩恒常性机制错误地"修正"了并不需要修正的颜色——那个失败产物,那个大脑无法稳定消化的东西,就是余项。错觉就是知觉的余项。

Altun的独特之处不在于他知道这些错觉存在——任何心理学教科书都会讲它们——而在于他用着色器去重新生成它们。着色器是另一种凿构机制:它在GPU的并行管线上对每个像素执行相同的数学变换。当你用着色器实现一个错觉时,你做的事情很奇特:你在用一个无知觉的数学机器去精确复制一个知觉机器的失败模式。着色器不会被错觉欺骗——它只是忠实地输出了那些触发人类视觉系统失构的精确像素配置。这里产生了第二层余项:着色器计算与人类知觉之间的鸿沟本身。cuneus引擎甚至支持着色器热重载和实时参数调节——你可以拖动滑块,看着错觉的强度连续变化,知觉余项的大小在你眼前实时伸缩。

cuneus本身的诞生也是一个余项故事。它存在的原因是Nannou——Rust生态里最重要的创意编码框架——停止了开发。Altun在README里解释:他喜欢Nannou,他通过它学会了Rust,但它的wgpu版本太旧了。所以他用wgpu、egui和winit自己造了一个引擎,支持多通道渲染、原子操作、热重载、WASM导出、音频合成——甚至可以从WGSL着色器里直接生成音乐。cuneus是一个被遗弃的依赖项的余项:创意编码框架死了,从它的废墟里长出了一个GPU计算引擎。

这个项目现在处于什么命名间隙里?视觉心理学不会把着色器实现叫做"研究"。创意编码社区不会把严肃的心理物理学刺激叫做"艺术"。GPU系统编程社区不会把Café Wall错觉的参数空间探索叫做"工程"。Rust生态把cuneus当作一个着色器工具,但不知道它为什么要实现Gabor patch和Asahi错觉。它就坐在视觉神经科学、GPU计算、创意编码和心理物理学的交叉点上,任何一个领域都不会完整地命名它。这就是余项之美的结构特征:它在当下还是活的,还没有沉淀成某个领域的已构。

github.com/altunenes/cuneus ↗

Enes Altun is a psychologist and a Rust developer. What he does is something very few people do simultaneously: he writes optical illusions as GPU shaders. Not mimicking known art styles, not generating abstract patterns, but translating perceptual phenomena seriously studied in vision psychology literature — Munker illusion, Café Wall illusion, Pinna rotation illusion, Adelson's checker shadow, lilac chaser — one by one into WGSL shader code, running them in real time on the GPU. He built two projects for this: rusty_art (an ever-growing collection of illusions and generative art) and cuneus (a GPU compute shader engine he built from scratch).

In the SAE framework, there is a precise remainder structure here. What is an optical illusion? It is the failure product of the visual system's chisel-construct operation. The brain continuously executes the chisel-construct cycle on raw sensory data — chiseling noise from retinal input, constructing stable perceptual objects: edges, depth, color constancy, motion direction. This process works well most of the time, and its product is "normal perception" — that is already construct, already-sediment, beauty that vision science has spent a hundred and fifty years naming. But illusions occur at the precise nodes where chisel-construct fails: when the Café Wall's gray mortar lines cause the edge detection system to generate erroneous tilt signals, when Munker's colored stripes cause the color constancy mechanism to "correct" colors that need no correction — that failure product, that thing the brain cannot stably digest, is the remainder. Illusion is the remainder of perception.

Altun's distinctiveness lies not in knowing these illusions exist — any psychology textbook covers them — but in using shaders to regenerate them. A shader is another kind of chisel-construct mechanism: it executes the same mathematical transformation on every pixel across the GPU's parallel pipeline. When you implement an illusion in a shader, you do something strange: you use a perception-less mathematical machine to precisely replicate the failure modes of a perceptual machine. The shader is not fooled by the illusion — it simply outputs the exact pixel configurations that trigger the human visual system's de-construction. This generates a second layer of remainder: the gap itself between shader computation and human perception. The cuneus engine even supports hot shader reloading and real-time parameter adjustment — you can drag sliders and watch the illusion's intensity change continuously, the perceptual remainder expanding and contracting before your eyes in real time.

The birth of cuneus itself is a remainder story. It exists because Nannou — the most important creative coding framework in the Rust ecosystem — stopped being developed. Altun explains in his README: he liked Nannou, he learned Rust through it, but its wgpu version was too old. So he built his own engine from wgpu, egui, and winit, supporting multi-pass rendering, atomics, hot reload, WASM export, audio synthesis — you can even generate music directly from WGSL shaders. Cuneus is the remainder of an abandoned dependency: the creative coding framework died, and from its ruins grew a GPU compute engine.

Where does this project sit in the naming gap? Vision psychology would not call a shader implementation "research." The creative coding community would not call serious psychophysical stimuli "art." The GPU systems programming community would not call Café Wall parameter space exploration "engineering." The Rust ecosystem sees cuneus as a shader tool but does not know why it implements Gabor patches and Asahi illusions. It sits at the intersection of visual neuroscience, GPU computing, creative coding, and psychophysics, and none of these fields will fully name it. This is the structural signature of the beauty of the remainder: it is still alive in the present, not yet sedimented into any field's construct.

github.com/altunenes/cuneus ↗