跳到正文
网页珍奇柜Web Curio

黏菌网络

gpu-io Physarum,Amanda Ghassaei,2022 年

正在布展…

原作直展:这是 Amanda Ghassaei 的原始作品,按 MIT(附带 Tweakpane、Micromodal、canvas-capture 均为 MIT) 许可证收录(版本 14a6081)。原样展出仓库里的示例与 gpu-io 构建,只删掉了指向未收录 source map 的注释。在画面上拖动可撒下引诱剂,右侧面板有多组预设;存图和录像在沙箱里无法下载。 许可证全文 · 收录说明

它是怎么做的

  1. 第 1 步每个粒子有位置和朝向,存储在浮点纹理里
  2. 第 2 步粒子在前方、左前、右前三个点采样痕迹图,向浓度最高的方向转向
  3. 第 3 步粒子前进后在所在像素沉积痕迹
  4. 第 4 步痕迹图每帧做一次模糊(扩散)并乘以衰减系数
  5. 第 5 步痕迹图直接作为画面,按浓度上色

复刻配方

一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。

Keep agent positions and headings in a float texture and a separate trail-map texture. In an agent update shader, sample the trail at a sensor distance ahead, ahead-left and ahead-right by a sensor angle, rotate the heading toward the strongest reading (with a little randomness), and step forward. Render agents as points additively into the trail map to deposit, then run a 3x3 blur and multiply by a decay factor. Display the trail map with a colour ramp and expose sensor angle, distance, turn rate and decay as sliders.

档案

能不能拿来用

原作以 MIT 许可开源:可以阅读源码学习,按许可证条款使用;在自己的项目里引用时保留原作者署名。

性能开销

视觉强度

实现难度

尺度为策展判断(1 到 5),用于比较和推荐。

核实记录:Opened https://apps.amandaghassaei.com/gpu-io/examples/physarum/ (200, title 'Physarum'); repo amandaghassaei/gpu-io exists, licence MIT via GitHub API; examples/physarum contains index.html and index.js.