1实现原理 · 为什么它能做到
产出镜头:一条 22.5s 的完整「冰序列」——logo → 第一段文字 → 第二段文字 → 碎裂 → 淡出;相机绕着固定物体公转,并为可读性安排更慢的正面通过;同一套粒子场承载每一次转场。
A complete 22.5-second ice sequence: logo, first text, second text, breakup, and fade. The camera orbits the fixed objects with slower front-facing passes for reading. The same particle field carries each transition.
参数面 216 个变量,是本批之最(含材质 IOR/厚度/吸收/背光、粒子飞行重力与湍流、文字网格细节等)。
HyperFrames block, 1920×1080, 22.5s, 216 variables. … | `textMeshDetail` | number | `4` | Type · Text mesh detail (1-4; higher = smoother deformation) 1–4 step 1 |
composition id 与目录名不同:目录/条目名是 frost-sequence-camera-orbit,而 composition id 是 frost-sequence-rig(时间线也注册在这个 id 下),挂载与渲染时不要按目录名猜 id。
data-composition-id="frost-sequence-rig" … One paused GSAP timeline registered as `window.__timelines["frost-sequence-rig"]`.
渲染走 WebGPU/TSL 而非 WebGL:assets/frost.js 是约 1.5 MB 的 IIFE 打包产物(暴露 window.Frost),由 src/frost.ts + [email protected] 的 WebGPU/TSL 与 three-mesh-bvh 打出来。
// Bundle src/frost.ts (+ [email protected] WebGPU/TSL, three-mesh-bvh) into one … classic IIFE at assets/frost.js exposing `window.Frost`.
构建前有两道自检:源码级 TypeScript 预检,以及「无 GPU 生成 WGSL 的 shader 编译探针」,用来抓只在编译期暴露的 shader 缺陷。
`build.mjs` runs two checks before bundling: a source-only TypeScript pass (`tools/compile-preflight.mjs`) and a headless shader-compile probe (`tools/run-shard-compile.mjs`) that generates the WGSL for one shard without a GPU, to catch a class of shader bug that only shows up at compile time.
WebGPU 是硬要求:拿不到 navigator.gpu 或适配器就直接抛错。
if (!nav.gpu) throw new Error("Frost: navigator.gpu is unavailable (WebGPU required)"); … const adapter = await nav.gpu.requestAdapter().catch(() => null);
logo 只能来自项目资产:URL 白名单拒绝任何 scheme 或协议相对 host,只允许相对/根相对路径与内联 SVG data URI,越界直接抛错。
A relative or root-relative path, or an inline SVG data URI: never a scheme or protocol-relative host. … if (!isProjectAssetUrl(url)) throw new Error("The logo must be a project asset path, not " + url);
装机期需要补两个二进制资产(碎片图集与冰内含物贴图)——registry-item 里带 static.heygen.ai 的 url,SKILL.md 明写 fetched from the CDN at install。
"url": "https://static.heygen.ai/hyperframes-oss/registry-assets/122961c82d240e47.png" … "url": "https://static.heygen.ai/hyperframes-oss/registry-assets/4bea3a8ab90c9527.png"
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| cli | HyperFrames 官方 CLI(add / render;安装时按 registry-item 的 url 拉资产) |
| network | 装机期资产下载(官方 CDN,两个二进制 registry-assets) |
| package | [email protected](WebGPU/TSL)+ [email protected],已打进 assets/frost.js(均 MIT) |
| package | 源码重建依赖(仅改 source/ 时需要):esbuild、opentype.js、three 0.185.1、three-mesh-bvh、typescript |
| package | 随块字体(Geist Regular/SemiBold/Bold,OFL)与噪声/冰内含物贴图 |
4风险提醒 风险提醒:蓝色 · 知晓即可
- WebGPU 是硬门槛 — navigator.gpu 或适配器缺失即抛错(source/src/frost.ts);渲染主机/浏览器需支持 WebGPU,headless 环境需相应后端。
- 装机需联网 — 两个二进制资产以 CDN url 形式留在 registry-item.json,安装时由 CLI 拉取(static.heygen.ai);镜像/内网环境需预先准备。
- 体积与内存 — frost.js 约 1.5 MB + composition 131 KB,SKILL.md 自述约 350 MB/实例、一次一个;多块并列风险高。
- 216 个变量的可用性成本 — 变量表极长,人工调参需要索引;错误值虽被 optionsFrom 拦下,但排查点会分散在 buildStatus 上。
- 源码子集不含测试与调参台 — source/README.md 明写原项目的测试套件与独立视觉调参 UI(workbench/)未包含,改了源码后需自建验证路径。
5第二遍独立确认
- [ok] 变量数与声明一致性(frontmatter 自称 216 variables) — 脚本实测:SKILL.md 变量表 216 行、html data-composition-variables 解析出 216 项、frontmatter 写 216 —— 一致(本批最大变量表)。
- [ok] composition id 与目录名不一致 — SKILL.md 挂载片段与 Runtime contract 都写 frost-sequence-rig,html data-composition-id 亦为 frost-sequence-rig;目录/条目名是 frost-sequence-camera-orbit。非缺陷,但挂载时不可按目录名猜 id。
- [discrepancy] source/README 声称与分发内容的差异 — README 说 build.mjs 会产出 ../assets/frost.js 与 ../assets/motion.js,但 registry-item.json 的分发清单只含 frost.js,盘上 assets/ 也没有 motion.js —— 安装后那份「轻量 WebGL 编辑辅助」并不随块提供。
- [ok] localStorage 出现位置 — 仅见于 source/src/motion/editor.ts(getItem/setItem 包在 try/catch 里);该模块的产物 motion.js 未随块分发(见上一条),因此不构成安装后的实际接触面。
- [ok] 装机期 CDN 资产声称 — registry-item.json 中 shards-atlas.png 与 textures/ice-inclusions-generated.png 两项带 static.heygen.ai 的 url,盘上确实缺失,与 SKILL.md 的 fetched from the CDN at install 一致。
- [ok] WebGPU 硬门槛与构建自检 — src/frost.ts 中 navigator.gpu 缺失即 throw(并附 requestAdapter 的 null 分支);source/README.md 描述的两道构建前自检对应 tools/compile-preflight.mjs 与 tools/run-shard-compile.mjs(后者 import node:child_process 的 spawnSync)。
- [ok] 凭证扫描 — 对 SKILL.md / html / registry-item.json / source/ 扫描 process.env、secret、token、api_key、cookie、sudo、sandbox:无真实命中(仅 curl noise 之类注释文字误配)。
6结论
d873fafcf97f3f6b…d2f0bc7f34