向量场游乐场
Field Play,Andrei Kashcha (anvaka),2017 年

正在布展…
它是怎么做的
- 第 1 步粒子位置编码在纹理中,每帧在片元着色器里按场函数积分
- 第 2 步用户输入的表达式被拼接进着色器源码重新编译
- 第 3 步上一帧画面以低透明度淡出,形成拖尾
- 第 4 步粒子定期随机重生,避免堆积在汇点
复刻配方
一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。
Encode particle positions in an RGBA texture (or two textures for float precision) and update them each frame in a fragment shader that evaluates a user-supplied velocity function. Let the user type the function body and splice it into the shader source, recompiling on change and showing compile errors inline. Render particles as GL points into a framebuffer that is first drawn with the previous frame at slightly reduced opacity, producing trails. Randomly respawn a small fraction of particles each frame and serialise the expression and view into the URL.


