跳到正文
网页珍奇柜Web Curio

随音乐呼吸的粒子球

ThreeJS Audio Reactive Visual,Francesco Michelini (kekkorider),2021 年

正在布展…

本柜的现场复刻:按原作的技术思路从零编写,不含原作的代码和素材。为什么不直接展出原作:原作附带的音乐文件(static/music.mp3)没有注明来源和许可,不能确定可以转载,所以本柜从零复刻,音乐改为在浏览器里现场合成。原作请点上方「去看原作」。

它是怎么做的

  1. 第 1 步MeshSurfaceSampler 在球面(或模型表面)上采样点位生成粒子
  2. 第 2 步THREE.AudioAnalyser 读取 128 段频谱并取平均
  3. 第 3 步频谱值作为 uniform 传入,顶点着色器用噪声+频谱位移粒子
  4. 第 4 步余弦调色板(palette.glsl)按位移量着色

复刻配方

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

Sample a few thousand points on the surface of a sphere or GLB model with MeshSurfaceSampler and store them in a Points geometry with a random attribute per point. Play a track through THREE.Audio and read frequency data from an AudioAnalyser each frame, reducing it to low, mid and high band averages. Pass these as uniforms and in the vertex shader displace each point along its normal by 3D noise scaled by the bass value. Color with a cosine palette indexed by displacement, and gate audio start behind a click to satisfy autoplay policies.

档案

能不能拿来用

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

性能开销

视觉强度

实现难度

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

核实记录:Demo loads (200); repo has MIT LICENSE; source confirms AudioAnalyser + MeshSurfaceSampler.