1仕組みと動作原理
能力の基盤は「1ピクセルごとに1回色を計算する」GPU並列モデルです。まずこの前提を確立した上で、すべてのエフェクトをフラグメントシェーダー(uniformの純粋関数)として記述します。
Write GPU fragment shaders for generative motion, gradients, transitions, and post-processing. Fragment shaders run once per pixel in parallel — the most performant way to do full-screen generative motion.
骨格を「正規化座標 → アスペクト比補正 → カラー」に固定し、最短経路としてIQコサインパレット(a + b*cos(2π(c*t+d)))を提供します。
The cosine-palette line above (Inigo Quilez palettes) is the fastest route to a good-looking animated gradient: `a + b*cos(2π*(c*t + d))` with tunable `a,b,c,d` vec3s.
4つの基本ブロックですべてのレシピを構成します:smoothstep+mix(1ピクセル幅のアンチエイリアス境界を作るfwidthとの組み合わせ)、テクスチャレスなhash/値ノイズとfbm、SDF形状、ドメインワーピング(ノイズにノイズを入力)。
**smoothstep + mix** are the workhorses. `smoothstep(e0, e1, x)` gives a smooth 0→1 ramp; `mix(a, b, t)` linearly blends. Antialias an edge by the width of one pixel:
画像トランジションを「2枚のテクスチャ + 1つのu_progress」モデルに統合します:ノイズ閾値ディゾルブ、ディスプレイスメントマップによるUV変位、グリッチ(行ごとのhash変位 + RGBチャンネルシフト)。
Sample two textures and blend per pixel by a progress uniform `u_progress` (0→1).
Three.jsの連携コードを実行可能な完全な骨格(uniforms + ShaderMaterial + クリップ空間を覆う2×2平面 + 投影なしカメラ)として提供し、「画面全体パスでpositionを直接出力する」ケースと「実際のジオメトリでvUvが必要な」ケースを区別します。
For a full-screen pass with a plain camera, write the vertex shader to output `position` directly and skip projection (as above). For shaders applied to real geometry, pass `vUv` from the vertex shader via `varying vec2 vUv;
モバイル/パフォーマンスの規則はスタイルの提案ではなくGLSL ESのハード制約です:ループ上限は定数必須、octave ≤5–6、ホットパスでの分岐回避、texture2Dおよび依存テクスチャ読み出しの削減、必要に応じたhighp/mediumpの使い分け、さらにES 3.00への移行ポイントを提示します。
Loops must have **constant bounds** in GLSL ES — no dynamic loop counts. Keep fbm octaves ≤ 5–6.
決定論的再現性は「シェーダーがuniformの純粋関数である」という性質に基づきます:すべてのアニメーションはu_time(トランジション時はさらにu_progress)のみを経由し、シェーダー内のランダム性は確定的なhash(uv)から得られるため、フレームごとのシード注入は不要です。
The shader is a pure function of uniforms — drive everything from `u_time` (and `u_progress` for transitions). All animation flows through one uniform you can pin.
2コア機能
3外部依存関係
| Kind | Dependency / Endpoint |
|---|---|
| cli | npx playwright screenshot(验证回路:截 file:// 页面在 ?t=2.0 的冻结帧) |
| cli | 仓库根共享脚本 scripts/seek-shot.sh、scripts/contact-sheet.sh(截图与接触表拼图;不在 skill 目录内) |
| cli | ffmpeg / ffprobe(contact-sheet.sh 与 probe-mp4.sh) |
| network | 交付 HTML 经 importmap 从 CDN 取 three(产物期,浏览器端拉取) |
4推奨統制措置と判定根拠
- scripts/: ローカルスクリプトまたはコマンドの実行: (SKILL.md内の指示)npx playwright screenshot --wait-for-timeout=600 "file://$PWD/
- 网络端点: 外部ネットワークアクセスの宣言: スキルディレクトリ内にネットワーク呼び出しコードは存在しません。実行時のネットワーク通信は`npx playwright`によるツール取得(npmレジストリ + Chromiumバイナリのダウンロード)のみです
- 本地工作目录: ファイルの読み書きと成果物出力: 提供される成果物本体:単一のshader.html(出力規約に従ってエージェントが作成)
5二重目の独立検証
- [ok] 「skill 目录内无脚本」是否成立(蓝档的关键前提) — 文件清单实证:skills/shader-glsl/ 下只有 SKILL.md、README.md(0 B)、references/glsl-cookbook.md。SKILL.md 引用的 `scripts/seek-shot.sh` 属仓库根资产,已在 reason/risks 记录为「单装 skill 目录会悬空」。
- [ok] 凭证/环境变量读取是否存在 — 本仓(webgl-animation-skills)全仓 `process.env|API_KEY|TOKEN|SECRET|Authorization` 零命中;本 skill 的 credential_reads 为空成立。
- [ok] 是否有更高的触发条件被漏掉(红档特征) — `sandbox|automationcontrolled|no-verify|stealth|bypass|ignoreHTTPSErrors|dangerously` 全仓零命中;无任意代码执行面(交付物是浏览器沙箱内的 GLSL/JS)。
- [ok] 「shader 是 uniform 的纯函数 → ?t=N 可复现」是否与 harness 代码相符 — harness 段在 `?t=N` 分支直接 `frame(parseFloat(t))`(同时把 u_progress 钉到 N),非冻结分支才用 clock + setAnimationLoop;与「只有一个时钟来源」的声明一致,无夸大。
- [ok] GLSL ES 限制类声明是否确实写在文档内(非推测) — 原文 'Loops must have **constant bounds** in GLSL ES — no dynamic loop counts. Keep fbm octaves ≤ 5–6.';移动端精度段(mediump/highp、pixelRatio 上限、低分辨率 RT 上采样)亦可逐条定位。
- [ok] reference 内容与 SKILL.md 描述是否一致 — glsl-cookbook.md 开篇 'Complete, copy-pasteable GLSL for noise, SDFs, palettes, domain warping, transitions, and Three.js wiring.',随后逐节给出 IQ 调色板、hash21/hash22/valueNoise、SDF 与 domain warping 实现,与 SKILL.md 末尾能力清单对得上。
6結論
b6013fd669696c7f…