Skip to content

Agent skills that make real-time game VFX: procedural Effekseer effects, video-model flipbooks, or both, played in Godot and Unity (Claude Code, Codex and other Agent Skills hosts).

Python

Kaiju-scale extension: world scale, beams, charge chains, soft particles, photographic fire

Kanac28919890f04
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index d18abeb..b12384f 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -11,7 +11,7 @@
"name": "effekseer-vfx",
"source": "./",
"description": "Author real-time game VFX as code for Effekseer and verify them in real Godot renders.",
- "version": "0.1.1"
+ "version": "0.2.0"
}
]
}
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index 1dfc9b5..5e14de7 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "effekseer-vfx",
- "version": "0.1.1",
+ "version": "0.2.0",
"description": "Author real-time game VFX as code for Effekseer and verify them in real Godot renders: briefs, textures, recipes, EffekseerCore build, filmstrip review and independent scoring.",
"author": {
"name": "KanaWorks_AI",
diff --git a/README.ja.md b/README.ja.md
index 3706811..8c41997 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -11,7 +11,8 @@
- **`effekseer-vfx`** — 制作スキル。クラフトルール、実測で確認済みの Effekseer/Godot エンジン規約、組み合わせて使える約 30 個のレイヤープリミティブ、静的 linter、save/open の読み戻し検証付きの公式 EffekseerCore コンパイラ、すべてのエフェクトを 2 体のダミー間のやり取りとして演出する Godot Lab、ピクセルフラグ付きのフィルムストリップ撮影、反復履歴、そしてレビューを実際に見たビルドへ結び付ける改ざん検知可能なエビデンスを備えています。
- **`vfx-review`** — レビュアースキル。作者は自分の作品を採点しないため、別のエージェントがレシピを見ずに、固定の評価基準でストリップを採点します。
-- **サンプル** — 完成済みのエフェクト 13 種。ブリーフとテクスチャ付き:遠距離ペア 4 組(炎、氷、毒、闇:飛翔体 + 着弾)と、ヒット・斬撃・チャージ・シールド・ヒール各 1 種。前後比較の診断事例 3 件も付属。
+- **サンプル** — 完成済みのエフェクト 16 種。ブリーフとテクスチャ付き:遠距離ペア 4 組(炎、氷、毒、闇:飛翔体 + 着弾)、ヒット・斬撃・チャージ・シールド・ヒール各 1 種、そして怪獣セット(背びれを昇っていくチャージ、薙ぎ払えるアトミックビーム、写真調の爆発)。前後比較の診断事例 3 件も付属。
+- **大規模でリアルなエフェクト** — `scale='kaiju'` は、キャラクタースケールのレシピを 40 倍大きく 2.5 倍遅くビルドします(サイズ、速度、重力、予算、レビューのカメラがすべて追従します)。`beam()` は、ゲームが毎フレーム終点を動かす保持型のビームを作ります(`Vfx.beam()` → `aim()` → `release()`)。`charge_chain()` は点の連なりに沿ってアークを灯します。写真調の炎、煤、煙のフリップブック。Forward+ で検証済みのソフトパーティクル。
## 動作要件
@@ -111,7 +112,18 @@ var shot = Vfx.launch("VFX_Projectile_Fire", from, to)
shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))
```
-[`docs/ja/references/godot.md`](docs/ja/references/godot.md) を参照してください(英語原文:[`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md))。
+ビームは毎フレーム狙いを付けます。終点(レイキャスト、ターゲットのボーン)はゲームが持ちます。
+
+```gdscript
+var ray = Vfx.beam("VFX_Kaiju_Atomic_Beam", mouth, target)
+ray.aim(mouth, new_target) # each frame: sweep, follow the head
+ray.release() # narrows and fades out, then frees itself
+```
+
+`aim()` は毎フレーム呼び、薙ぎ払いと頭部への追従を行います。`release()` でビームは細くなってフェードアウトし、その後自身を解放します。
+
+[`docs/ja/references/godot.md`](docs/ja/references/godot.md) を参照してください(英語原文:[`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md))。巨人や怪獣については
+[`docs/ja/references/scale.md`](docs/ja/references/scale.md)(英語原文:[`skills/effekseer-vfx/references/scale.md`](skills/effekseer-vfx/references/scale.md))も参照してください。
## リポジトリ構成
@@ -139,8 +151,8 @@ tests/ pure-Python tests (no Core or Godot needed)
- レビューのハーネスは macOS と Windows 上でウィンドウ表示の Godot を操作します。ヘッドレス Linux での撮影はまだサポートしていません。
Windows では、撮影中 Godot ウィンドウがフォーカスを保持し続けます(macOS ではフォーカスがお使いのアプリに戻ります)。
- Windows では、シンボリックリンクの安全性テストに開発者モード(または管理者権限のシェル)が必要で、無効だとスキップされます。
-- サンプルのスコアは、スキル同梱のカプセル Lab でのレンダーに対する独立レビューの結果です(13 種のうち 2 種は `iterate` 判定)。頼りにする前に、ビルドとレビューをやり直してください。
-- `soft` パーティクルは Forward+ の Lab で未検証のため、使用していません。
+- サンプルのスコアは、スキル同梱のカプセル Lab でのレンダーに対する独立レビューの結果です(16 種のうち 2 種は `iterate` 判定)。頼りにする前に、ビルドとレビューをやり直してください。
+- `soft` パーティクルは Forward+ で検証済みです(フェードするのは不透明な深度に対してだけです)。Compatibility レンダラーには深度テクスチャがなく、使用できません。
## 開発
diff --git a/README.md b/README.md
index 0223e6d..c3be1e1 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,13 @@ Agent skills that let a coding agent (Claude Code, Codex, Cursor, Gemini CLI, Gi
tamper-evident evidence that ties a review to the exact build it saw.
- **`vfx-review`** — the reviewer skill: a separate agent scores the strip against a fixed rubric without seeing the
recipe, because the author never grades its own work.
-- **Examples** — thirteen finished effects with briefs and textures: four ranged pairs (fire, ice, poison, dark:
- projectile + impact) and one each of hit, slash, charge, shield and heal, plus three diagnosed before/after cases.
+- **Examples** — sixteen finished effects with briefs and textures: four ranged pairs (fire, ice, poison, dark:
+ projectile + impact), one each of hit, slash, charge, shield and heal, and a kaiju set (a charge that climbs the
+ dorsal plates, a sweepable atomic beam, a photographic explosion), plus three diagnosed before/after cases.
+- **Large and realistic effects** — `scale='kaiju'` builds a character-scale recipe 40x larger and 2.5x slower
+ (sizes, speeds, gravity, budgets and the review camera all follow); `beam()` makes a held beam whose end point the
+ game moves every frame (`Vfx.beam()` → `aim()` → `release()`); `charge_chain()` lights arcs along a chain of
+ points; photographic fire, soot and smoke flipbooks; soft particles verified in Forward+.
## Requirements
@@ -131,7 +136,16 @@ var shot = Vfx.launch("VFX_Projectile_Fire", from, to)
shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))
```
-See [`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md).
+Beams are aimed every frame; the game owns the end point (a ray cast, a target bone):
+
+```gdscript
+var ray = Vfx.beam("VFX_Kaiju_Atomic_Beam", mouth, target)
+ray.aim(mouth, new_target) # each frame: sweep, follow the head
+ray.release() # narrows and fades out, then frees itself
+```
+
+See [`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md) and, for giants and kaiju,
+[`references/scale.md`](skills/effekseer-vfx/references/scale.md).
## Repository layout
@@ -151,9 +165,10 @@ tests/ pure-Python tests (no Core or Godot needed)
- The review harness drives a windowed Godot on macOS and Windows; headless Linux capture is not supported yet. On
Windows the Godot window keeps focus while it captures (macOS hands focus back to your app).
- On Windows, the symlink-safety tests need Developer Mode (or an administrator shell) and are skipped without it.
-- Example scores are an independent review of the skill's own capsule-Lab renders (two of the thirteen were judged
+- Example scores are an independent review of the skill's own capsule-Lab renders (two of the sixteen were judged
`iterate`); rebuild and review before relying on them.
-- `soft` particles are unverified in the Forward+ Lab and not used.
+- `soft` particles are verified in Forward+ (they fade against opaque depth only); the Compatibility renderer has no
+ depth texture and cannot use them.
## Development
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 192dd47..77f1c47 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -13,7 +13,8 @@
静态检查器、带 save/open 回读的官方 EffekseerCore 编译器、把每个效果演成两个假人之间一次交锋的 Godot Lab、
带像素 flag 的连拍采集、迭代历史,以及把评审绑定到它所看构建的防篡改证据。
- **`vfx-review`** —— 评审技能:由另一个 agent 在看不到配方的情况下,按固定评分表给连拍图打分,因为作者从不给自己的作品打分。
-- **示例** —— 十三个完成的效果,附设计简报和纹理:四组远程配对(火、冰、毒、暗:飞行体 + 命中),以及打击、斩击、蓄力、护盾、治疗各一个;另有三个前后对照的诊断教案。
+- **示例** —— 十六个完成的效果,附设计简报和纹理:四组远程配对(火、冰、毒、暗:飞行体 + 命中),打击、斩击、蓄力、护盾、治疗各一个,以及一个怪兽套组(沿背鳍骨板攀升的蓄力、可以扫动的原子光束、照片级的爆炸);另有三个前后对照的诊断教案。
+- **大型与写实效果** —— `scale='kaiju'` 把角色尺度的配方构建得大 40 倍、慢 2.5 倍(尺寸、速度、重力、预算和复查镜头全都随之变化);`beam()` 制作一条持续光束,终点由游戏每帧移动(`Vfx.beam()` → `aim()` → `release()`);`charge_chain()` 沿一串点点亮电弧;照片级的火焰、烟灰和烟雾序列帧;软粒子已在 Forward+ 中验证。
## 环境要求
@@ -115,8 +116,19 @@ var shot = Vfx.launch("VFX_Projectile_Fire", from, to)
shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))
```
+光束需要每帧瞄准;终点由游戏掌握(射线检测结果、目标骨骼):
+
+```gdscript
+var ray = Vfx.beam("VFX_Kaiju_Atomic_Beam", mouth, target)
+ray.aim(mouth, new_target) # each frame: sweep, follow the head
+ray.release() # narrows and fades out, then frees itself
+```
+
+(`aim()` 每帧调用:扫动、跟随头部;`release()` 让光束变细并淡出,然后自行释放。)
+
参见 [`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md)(中文译文:
-[docs/zh/references/godot.md](docs/zh/references/godot.md))。
+[docs/zh/references/godot.md](docs/zh/references/godot.md));巨人和怪兽另见
+[`references/scale.md`](skills/effekseer-vfx/references/scale.md)(中文译文:[docs/zh/references/scale.md](docs/zh/references/scale.md))。
## 仓库结构
@@ -141,8 +153,8 @@ tests/ pure-Python tests (no Core or Godot needed)
- 复查工具驱动的是 macOS 和 Windows 上带窗口的 Godot;暂不支持无头 Linux 采集。在 Windows 上,Godot 窗口在采集期间会一直
占着焦点(macOS 会把焦点还给你的应用)。
- 在 Windows 上,符号链接安全测试需要开启开发者模式(或使用管理员 shell),否则会被跳过。
-- 示例分数来自对 skill 自带胶囊 Lab 渲染的独立评审(十三个中有两个被判为 `iterate`);依赖它们之前请重新构建并复查。
-- `soft` 粒子在 Forward+ Lab 中未经验证,未被使用。
+- 示例分数来自对 skill 自带胶囊 Lab 渲染的独立评审(十六个中有两个被判为 `iterate`);依赖它们之前请重新构建并复查。
+- `soft` 粒子已在 Forward+ 中验证(只会对不透明深度淡出);Compatibility 渲染器没有深度纹理,无法使用它们。
## 开发
diff --git a/docs/ja/README.md b/docs/ja/README.md
index 007e2a5..27581a8 100644
--- a/docs/ja/README.md
+++ b/docs/ja/README.md
@@ -26,7 +26,9 @@
| [review.md](references/review.md) | レビューループ、エビデンス、納品:フラグ、ストリップの読み方、独立レビュー、検証 |
| [cases.md](references/cases.md) | 診断済みのケース:火の爆発、飛翔体の煙のテール、シールドの崩れを再構成したビフォー/アフター(画像付き) |
| [cli.md](references/cli.md) | コマンドリファレンスと作業領域の構成 |
-| [examples.md](references/examples.md) | 同梱サンプル:炎・氷・毒・闇の飛翔体と着弾のペア 4 組と、ヒット・斬撃・チャージ・シールド・ヒールの単体 5 つ |
-| [godot.md](references/godot.md) | Godot でエフェクトを使う:API、Lab、チェック |
-| [engine-conventions.md](references/engine-conventions.md) | 検証済みのエンジン規約:角度と軸、力、メッシュとフレネル、フリップブック、継承、HDR、アンカー、コンパイラの拡張 |
-| [primitives.md](references/primitives.md) | レシピコードとプリミティブ:`effect()` のフィールド、プリミティブ、ヘルパー、レイヤーフィールド、単位 |
+| [examples.md](references/examples.md) | 同梱サンプル:炎・氷・毒・闇の飛翔体と着弾のペア 4 組、ヒット・斬撃・チャージ・シールド・ヒールの単体 5 つ、怪獣セット(チャージ、ビーム、爆発) |
+| [godot.md](references/godot.md) | Godot でエフェクトを使う:API、ビーム、スケールしたエフェクト、ソフトパーティクル、Lab、チェック |
+| [engine-conventions.md](references/engine-conventions.md) | 検証済みのエンジン規約:角度と軸、力、メッシュとフレネル、フリップブック、継承、ゲーム入力と動的方程式、HDR とソフトパーティクル、アンカー、コンパイラの拡張 |
+| [primitives.md](references/primitives.md) | レシピコードとプリミティブ:`effect()` のフィールド、プリミティブ、ヘルパー、レイヤーフィールド、`bind`、単位 |
+| [scale.md](references/scale.md) | ワールドスケール:巨人・怪獣・軍艦向けの `scale` の宣言、変換されるもの、スケール時の Lab とチェック |
+| [realism.md](references/realism.md) | 写真調の爆発・炎・煙:写真から取る色と明るさ、写真調のフリップブック、地面との接触、レイヤー計画 |
diff --git a/docs/ja/SKILL.effekseer-vfx.md b/docs/ja/SKILL.effekseer-vfx.md
index 05f0f6a..1d5a532 100644
--- a/docs/ja/SKILL.effekseer-vfx.md
+++ b/docs/ja/SKILL.effekseer-vfx.md
@@ -20,7 +20,7 @@ Windows では、`sh <skill>/scripts/vfx` は Git Bash で動作します。cmd
`doctor` の `next` が、このマシン向けの正確なコマンドを表示します。
setup には Python 3.11+ か uv が必要です(macOS 標準の Python 3.9 は古すぎます)。`doctor` がどちらもないと報告したら、ユーザーにどちらかのインストールを頼みます。Godot 4(Forward+)はユーザーがインストールする必要があります。`PATH` 上にない場合は `GODOT` を設定します。
3. `vfx init` は `vfx/`(Godot Lab、マテリアル、数式テクスチャ、公式 Effekseer プラグイン)を作成します。`--update-templates` を付けない限り、既存のファイルは上書きしません。
-4. 任意:`vfx examples add <name>` で、完成済みで独立レビュー済みのサンプルを学習用にコピーします:ペアは `fire`、`ice`、`poison`、`dark`(飛翔体 + 着弾)、単体は `hit`、`slash`、`charge`、`shield`、`heal`、または `all`。[references/examples.md](references/examples.md) を参照してください。
+4. 任意:`vfx examples add <name>` で、完成済みで独立レビュー済みのサンプルを学習用にコピーします:ペアは `fire`、`ice`、`poison`、`dark`(飛翔体 + 着弾)、単体は `hit`、`slash`、`charge`、`shield`、`heal`、セット `kaiju`(ワールドスケール、ビーム、チャージチェーン、写真調の爆発)、または `all`。[references/examples.md](references/examples.md) を参照してください。
`vfx review`、`preview`、`showcase` はユーザーのデスクトップに Godot のウィンドウを開きます。サンドボックス内で動いている場合(Codex のワークスペース
サンドボックスなど)は、ユーザーの承認を得てサンドボックスの外で実行します。外に出られない場合は、完全なコマンドをユーザーに渡してデスクトップの
@@ -32,7 +32,7 @@ Windows では、`sh <skill>/scripts/vfx` は Git Bash で動作します。cmd
## エフェクトを一つ作る・変更する
-1. **書く前に読む。** [craft](references/craft.md)、[design](references/design.md)、[layering](references/layering.md)、[timing](references/timing.md)、[skeletons](references/skeletons.md) は必ず読み、さらに下のルーティング表にあるトピック別ファイルと、該当するサンプルのレイヤー計画を示す `vfx examples show <name>` を読みます(名前:`hit`、`slash`、`charge`、`shield`、`heal`。飛翔体や爆発などの着弾はペア `fire`、`ice`、`poison`、`dark`。エフェクト ID も使えます)。既存のエフェクトでは `vfx effect-context <ID>` を実行して履歴を読み、失敗した変更を繰り返さないようにします。
+1. **書く前に読む。** [craft](references/craft.md)、[design](references/design.md)、[layering](references/layering.md)、[timing](references/timing.md)、[skeletons](references/skeletons.md) は必ず読み、さらに下のルーティング表にあるトピック別ファイルと、該当するサンプルのレイヤー計画を示す `vfx examples show <name>` を読みます(名前:`hit`、`slash`、`charge`、`shield`、`heal`。飛翔体や爆発などの着弾はペア `fire`、`ice`、`poison`、`dark`。大規模、ビーム、リアルなエフェクトは `kaiju`。エフェクト ID も使えます)。既存のエフェクトでは `vfx effect-context <ID>` を実行して履歴を読み、失敗した変更を繰り返さないようにします。
2. **ブリーフ。** `vfx/briefs/<ID>.json` を書きます(キーフレーム 3 つ、パレットの役割、ビート、レイヤー計画、受け入れ条件、避けること)。形式は [design.md](references/design.md) にあります。
3. **テクスチャ。** 数式で作る形状(グロー、リング、ノイズ、トレイル、ディストーションマップ)と、ペイント系の煙・爆発・ウィスプ・亀裂・氷のスターターセットは、`init` の時点で揃っています。複雑なペイント系の形状(炎、斬撃、煙、亀裂、氷、ルーン)は画像生成モデルで作ります — [textures.md](references/textures.md) に従ってください。どのテクスチャも、その角度を使う前に `vfx texture-info` で計測します。
4. **レシピ。** [primitives.md](references/primitives.md) のプリミティブを使って `recipe()` を定義する `vfx/src/<ID>.py` を書きます。軸、単位、ブレンドの挙動は推測せず、[engine-conventions.md](references/engine-conventions.md) の検証済みエンジンルールに従います。
@@ -51,6 +51,7 @@ Windows では、`sh <skill>/scripts/vfx` は Git Bash で動作します。cmd
- 複雑なペイント系の形状を Python で描いてはいけません。画像生成ツールが使えない場合は、プロンプトを `vfx/texture_prompts.json` に書き、ユーザーに画像を依頼します。
- 生成した原画は `vfx/textures/generated/` に保持し、処理済みのコピーは `vfx/textures/processed/` に書き出します。プロンプトはすべて記録します。
- 単位:レシピのタイミングは 60 FPS のフレーム数、F カーブはライフに対するパーセント、マニフェストの duration/peak は秒、Godot API の rotation はラジアンです。
+- レシピは Lab のキャラクタースケールで書きます。より大きな世界では、数値を手でスケールするのではなく `scale` を宣言します([scale](references/scale.md))。ブリーフとレビューのフレームは、ビルド後のスケールされたタイムラインのものです。
- すべてのエフェクトは `delivery` を宣言します。飛翔体には、それを参照し返す対の着弾エフェクトが必要です。
- コンパイラが知っているレイヤーフィールド(`vfx layer-schema`)だけを使います。レシピに生のプロパティパスを書くのではなく、コンパイラを拡張します。
- `--ids` なしの全量 `vfx build` は、このスキルがビルドし、ソースが `vfx/src/` からなくなったエフェクトの出力を削除します。自分がビルドしていないエフェクトは決して削除せず、空のライブラリでは実行を拒否します。部分的な作業には `--ids` を使います(他の場所の壊れたソースは、作業を止めずに `unloaded` に報告されます)。
@@ -64,6 +65,9 @@ Windows では、`sh <skill>/scripts/vfx` は Git Bash で動作します。cmd
| 斬撃、飛翔体、チャージ、オーラなど移動するもの全般 | [motion.md](references/motion.md) |
| シールド、柱、ボス、状態異常、ボリューム、遮蔽 | [shapes.md](references/shapes.md) |
| リファレンス動画に合わせる | [reference.md](references/reference.md) |
+| 巨人、怪獣、軍艦:キャラクターよりはるかに大きいもの全般 | [scale.md](references/scale.md) |
+| ビーム、レーザー、ブレス攻撃、チャージチェーン、ゲームが実行時に動かす値 | [primitives.md](references/primitives.md)(`beam`、`charge_chain`、`bind`)、[godot.md](references/godot.md#ビーム) |
+| リアル / 写真調の爆発、炎、煙、蒸気 | [realism.md](references/realism.md) |
| 特定の見た目の失敗(白い塊、空のテール、崩れが出ない) | [cases.md](references/cases.md) |
| コンパイラへのエンジン機能の追加 | [engine-conventions.md](references/engine-conventions.md#コンパイラの拡張)、`vfx discover`、`vfx core property-list/get/set` |
| ゲームでエフェクトを使う | [godot.md](references/godot.md) |
diff --git a/docs/ja/references/cli.md b/docs/ja/references/cli.md
index 49f56c8..ea401d5 100644
--- a/docs/ja/references/cli.md
+++ b/docs/ja/references/cli.md
@@ -27,9 +27,9 @@
|---|---|---|
| `doctor` | — | プラットフォーム、ツールチェーン、作業領域。`modes` と `next` ステップ |
| `init [--update-templates] [--no-plugin]` | Python | `vfx/`(Lab、マテリアル、数式テクスチャ、ペイント系テクスチャのスターター)を作成/更新。公式 Effekseer Godot プラグインをダウンロード(チェックサム固定) |
-| `examples [list]` | — | 同梱のペアと単体エフェクト。過去のスコア、判定、最も弱い点付き |
-| `examples show <name\|ID>` | Python | 絶対フレームと役割付きのレイヤー計画(ペアなら両方のエフェクト) |
-| `examples add <name\|ID\|all> [--force]` | Python | サンプルのソース、ブリーフ、ペイント系テクスチャ、プロンプトをプロジェクトにコピー。名前:`fire`、`ice`、`poison`、`dark`、`hit`、`slash`、`charge`、`shield`、`heal` |
+| `examples [list]` | — | 同梱のペア、単体エフェクト、セット。過去のスコア、判定、最も弱い点付き |
+| `examples show <name\|ID>` | Python | 絶対フレームと役割付きのレイヤー計画(ペアやセットならすべてのエフェクト) |
+| `examples add <name\|ID\|all> [--force]` | Python | サンプルのソース、ブリーフ、ペイント系テクスチャ、プロンプトをプロジェクトにコピー。名前:`fire`、`ice`、`poison`、`dark`、`hit`、`slash`、`charge`、`shield`、`heal`、`kaiju` |
| `procedural` | Python | 数式プリミティブのテクスチャを再生成 |
| `list` | Python | `vfx/src` 内のエフェクトを、カテゴリ、タイミング、delivery、design、ビルド状態とともに一覧。読み込めないソースは `unloaded` に列挙 |
| `lint [--ids ...] [--timeline]` | Python | 静的ルール(エラー)とクラフト上のヒューリスティクス(警告)。下記参照 |
diff --git a/docs/ja/references/engine-conventions.md b/docs/ja/references/engine-conventions.md
index d7f447f..7a524cb 100644
--- a/docs/ja/references/engine-conventions.md
+++ b/docs/ja/references/engine-conventions.md
@@ -6,7 +6,7 @@
新しい規約を確認したら、計測方法と一緒にここへ追記してください。
目次:角度と軸 · 力とモーション · メッシュとフレネル · テクスチャとフリップブック · 継承とライフタイム ·
-レンダリング、HDR、Lab · アンカーと配置 · コンパイラの拡張
+ゲーム入力と動的方程式 · レンダリング、HDR、Lab · アンカーと配置 · コンパイラの拡張
## 角度と軸
@@ -24,6 +24,14 @@
ローカルの **+X** が外側を向き、+Y は上のままです。床に沿って転がり出る煙には `travel.end=[[d0,d1],0,0]` が必要で、
`[0,d,0]` にするとまっすぐ立ち昇る柱になってしまいます。`rotate=False` では変位はワールド方向になります
(立ち昇るパーティクルにはこちらを使います)。
+- **`rotate=True` の球の放出は PVA の `velocity` も回転させます**:`velocity=[0, v, 0]` は上ではなく、各パーティクルのランダムな
+ 生成方向へ飛びます。そのように放出した煙の柱は横へ流れて沈みました(レビューの `sinks` フラグ)。
+ `spawn=dict(shape='Sphere', radius=[...], rotate=False)` なら `velocity` はワールド方向のままです。
+- **軸固定ビルボード**:`billboard='YAxisFixed'` に `pivot='bottom'` を組み合わせると、原点からローカル +Y に沿って伸び、
+ その軸を中心に回ってカメラを向くクアッドになります — 軸を真正面から見下ろす場合を除き、どの角度からでも太さを保つビームです。
+ `DirectionalBillboard` は +Y をパーティクルの運動方向に揃えます。知覚できないほど小さな速度(1e-4 units/frame、
+ `charge_chain`)を与えると、オイラー角なしで静止したスプライトを任意の点へ向けられます(計測:曲がった背骨上の 7 点の連なりで、
+ アークがすべてのアンカーに届いた)。
- **`travel.end` は絶対的なローカル位置** であり、`position` からのオフセットではありません。また `rotate=True` の放出は
そのローカル座標系も回転させます。床を転がる煙は、`position` を床の高さにした `renderer='None'` のピボットの下に置きます。
ワールド方向の変位には `spawn rotate=False`(`spray`)を使います。
@@ -102,6 +110,20 @@
コンパイルに失敗します(コンパイラはカーブに固定の開始スケールを掛けるため。lint が拒否します)。サイズを変化させるには
2 つ目のレイヤーを使います。
+## ゲーム入力と動的方程式
+
+- **`bind` は Godot プラグインで実行時に機能します。** 動的方程式(`@O.y = @In0`)を持つ Fixed の位置やスケールは
+ 毎フレーム再計算されます:再生中のハンドルでプローブが `@In0` を 3 → 9 → 5 と変えると、ビームの長さと先端のフラッシュは
+ 2 フレーム以内に追従し、エミッターを回転させると狙いが変わりました。コンパイラは方程式を `Core.Dynamic.Equations` に書き込み
+ (同一のコードは共有される)、save/open の後にそれらを確認します。
+- **新しいハンドルは .efk の入力の既定値(レシピの `inputs`)から始まります**:最初のシミュレーションフレームで、kaiju ビームの
+ 着弾点のしぶきが実際の終点ではなく既定の 160 m の位置に出ました。そのため `Vfx.play()` / `Vfx.beam()` はハンドルを作った直後に
+ 入力を送り、`CombatVfxHandle` はその後も毎フレーム送り直します(初期のプローブで 0 になったのは、その .efk に既定値が保存されて
+ いなかったためです)。
+- **保持する本体**:ビームの本体は、長寿命のインスタンス一つではなく `held()` のクロスフェード(interval ごとにインスタンス一つ、
+ ライフ 2×interval、フェードはそれぞれ interval 一つ分)なので、`release()`(`stop_root()`)で時間どおりに終わります:ストリップでは
+ 怪獣のビームは解放から約 15 フレーム以内に細くなって消え、`TestApi.gd` は解放したビームが自身を解放することをチェックします。
+
## レンダリング、HDR、Lab
- **スクリーンディストーション `material='BackDistortion'`** は Godot プラグインで機能します(`hint_screen_texture`)。`distortion` は
@@ -120,8 +142,16 @@
`glow()` はテクスチャレイヤーであり、この HDR ポストプロセスではありません。ステージを変えたら総覧全体をレンダーし直します。
- ブルームが強いと、接触が正当に白熱しているエフェクトはピークのフレームで `washed out` を報告します。それは
1〜3 フレーム続くだけなので、ストリップで判断し、フラグを黙らせるためだけに接触を弱めてはいけません。
-- **ソフトパーティクル `soft`** は、以前の Compatibility レンダラーの Lab では使えませんでした(深度テクスチャがなく、スプライトが
- ほぼ完全に透明になった)。現在の Lab は Forward+ を使っていますが、`soft` は再検証されていません:使わず、機能すると主張もしないでください。
+- **ソフトパーティクル `soft` は Forward+ で機能します**(EffekseerForGodot4 1.80.5.1、Godot 4.7.2)。プラグインのシェーダーは
+ `hint_depth_texture` をサンプリングし、不透明な深度の手前 `soft` ワールドユニットにわたってパーティクルをフェードさせます。Lab の床に
+ 半分沈めた深度テスト付きのカードで計測しました:`soft` なしでは床の線で明るさが 1 ピクセル以内に 206 から 81 へ落ち、
+ `soft=0.3` では約 9 ピクセルにわたって 198 → 188 → 169 → 124 → 81 と滑らかに変化しました。空中のカードは `soft` の有無にかかわらず
+ まったく同じ色(216, 198, 155)を保ちました。パーティクルのサイズに近い `soft` はカード全体をフェードさせます(lint が警告します)。
+ 深度テクスチャに入るのは不透明なジオメトリだけです:煙を透明な水面に対して柔らかくするには、水面が深度を書き込む
+ (または不透明な深度プリパスを持つ)必要があります。Compatibility レンダラーには深度テクスチャがありません:以前の Lab ではそこで
+ `soft` がスプライトをほぼ完全に透明にしました — Compatibility では使わないでください。
+- **スケール時のステージフラッシュ**:Godot のオムニライトは 1/距離 で減衰する(attenuation 1)ので、Lab はフラッシュのエネルギーに
+ ステージのスケールの 2 乗ではなくスケールそのものを掛けます(2 乗にすると、怪獣のヒットでステージ全体が白飛びしました)。
## アンカーと配置
diff --git a/docs/ja/references/examples.md b/docs/ja/references/examples.md
index a7edbbd..00416be 100644
--- a/docs/ja/references/examples.md
+++ b/docs/ja/references/examples.md
@@ -2,7 +2,7 @@
# 同梱サンプル
-遠距離ペア 4 組(飛翔体と、その到達点で再生される着弾)と、よくあるカテゴリごとに一つずつの単体エフェクト 5 つがあります。
+遠距離ペア 4 組(飛翔体と、その到達点で再生される着弾)、よくあるカテゴリごとに一つずつの単体エフェクト 5 つ、そして怪獣セットがあります。
デザインブリーフ、ペイント系テクスチャ(処理済みのコピー)、それらを作ったプロンプトを備えた、完全なプロダクション用レシピです。
それぞれのレイヤーの役割は、[skeletons](skeletons.md) のカテゴリ別の骨格そのものです。
@@ -21,9 +21,17 @@
| `shield` | `VFX_Shield_Dome` | フレネルのシェルと細いリム、オーバーシュートするポップ、スキャンバンドを伴う保持、時間どおりに消える `shell_fragments` の崩れ |
| `heal` | `VFX_Heal` | インパクトフレームなし:床の紋章、スクロールする柱、リング、すべて昇ってイーズアウトするプラス記号と光の粒 |
+| セット | エフェクト | 学べること |
+|---|---|---|
+| `kaiju` | `VFX_Kaiju_Atomic_Charge`、`VFX_Kaiju_Atomic_Beam`、`VFX_Kaiju_Explosion` | `scale='kaiju'`(40 倍大きく 2.5 倍遅くビルド、[scale](scale.md))。ダミーの背中を昇っていく `charge_chain()`。ゲーム入力で駆動され、蒸気と焦げ跡を残す薙ぎ払い可能な `beam()`。煤、立ち昇る煙の柱、柔らかい地面の土埃を伴う写真調の爆発([realism](realism.md)) |
+
+怪獣セットは 70 m のダミーの間で演出され(Lab はエフェクトに合わせてステージをスケールします)、ビームはチャージの後に、
+ターゲットの手前の地面からその胸へと薙ぎ上げられます。
+
```sh
vfx examples # list with historical scores and verdicts
vfx examples show slash # layer plan, absolute frames, roles, budget (a pair shows both effects)
+vfx examples add kaiju # a set: the charge, the beam and the explosion
vfx examples add fire # copy into vfx/src, vfx/briefs, vfx/textures/processed, vfx/texture_prompts.json
vfx lint --ids VFX_Projectile_Fire VFX_Fire_Explosion
vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion
@@ -31,12 +39,14 @@ vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"
```
`vfx examples` は過去のスコアと判定付きの一覧、`vfx examples show` はレイヤー計画・絶対フレーム・役割・予算(ペアなら両方のエフェクト)、
-`vfx examples add fire` は `vfx/src`、`vfx/briefs`、`vfx/textures/processed`、`vfx/texture_prompts.json` へのコピーです。
+`vfx examples add kaiju` はセット(チャージ、ビーム、爆発)の追加、`vfx examples add fire` は `vfx/src`、`vfx/briefs`、`vfx/textures/processed`、`vfx/texture_prompts.json` へのコピーです。
過去のスコア(評価基準の項目ごとに 0〜3)は、スキル既定のカプセル Lab でのレンダーに対する独立レビューによるものです:ストリップ、
キーフレームシート、マニフェストのエントリ、フラグだけを見た 2 人のレビュアーが採点しました。11 個が `ship` と判定され、
`VFX_Projectile_Ice`(白いコアも暗い縁もない平板な槍で、飛行中に形が変わらない)と `VFX_Projectile_Dark`(到達後に経路に何も残らない)は
-`iterate` と判定されました。`vfx examples` は各サンプルの最も弱い評価項目と、レビュアーによる修正案一つ(`historical_review.worst`)を一覧にします。
+`iterate` と判定されました。kaiju セットも同じ方法で、スケールした Lab での自身のレンダーに対して独立レビューを受け、数回の修正の後
+3 つとも `ship` と判定されました(レビュアーの修正案:背板を体に沿わせる、1 枚ずつ点灯する結晶の背びれ、口へ集まる電光、くすぶる煙、
+炎より長く残る煙柱で終わりを埋める)。`vfx examples` は各サンプルの最も弱い評価項目と、レビュアーによる修正案一つ(`historical_review.worst`)を一覧にします。
スコアは参考であって、あなたのビルドの検証では **ありません**:ビルド、レビュー、採点をやり直してください。`--force` を付けない限り、
サンプルを追加しても既存のファイルは上書きされません。
diff --git a/docs/ja/references/godot.md b/docs/ja/references/godot.md
index 3b6befd..d024f06 100644
--- a/docs/ja/references/godot.md
+++ b/docs/ja/references/godot.md
@@ -28,15 +28,53 @@ shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))
`options.flight`(s)を指定しない限りマニフェストから取られ、`options.arc` で山なりに持ち上げます。
有限のエフェクトは `duration` の後に自動で片付けられ、ループするエフェクトは `stop()` まで再生を繰り返します。マニフェスト
-(`vfx_manifest.json`)は `id`、`duration`、`peak`、`impact`、`light`、`delivery`、`flight`、`arc`、`attach`、
-`design` を持ちます。Lab はステージのフラッシュとカメラキックに `impact`/`light`/`peak` を使いますが、ゲームではこれらを自前で実装します。
+(`vfx_manifest.json`)は `id`、`duration`、`peak`、`impact`、`light`、`delivery`、`flight`、`arc`、`hold`、
+`inputs`、`scale`、`attach`、`design` を持ちます。Lab はステージのフラッシュとカメラキックに `impact`/`light`/`peak` を使いますが、ゲームではこれらを自前で実装します。
+
+## ビーム
+
+`beam()` でビルドしたレシピ(マニフェストの `delivery.kind == "beam"`)は保持型のエフェクトで、その長さと出力は、`bind` の方程式が読む
+入力(`@In0` はワールド単位の長さ、`@In1` は出力 0–1)を通じてゲームが動かします:
+
+```gdscript
+var ray = Vfx.beam("VFX_Kaiju_Atomic_Beam", mouth.global_position, target_point) # ignites: power 0 -> 1
+func _process(_delta):
+ if is_instance_valid(ray) and not ray.released:
+ ray.aim(mouth.global_position, raycast_hit_point) # every frame: sweep, follow the head, stop at walls
+# when the breath ends:
+ray.release() # the beam narrows (power -> 0) and its last instances fade; the handle frees itself
+```
+
+補足:`Vfx.beam()` で点火し、出力が 0 から 1 へ上がります。`aim()` は毎フレーム呼び、薙ぎ払い、頭部への追従、壁での停止を行います。
+ブレスが終わったら `release()` を呼びます:ビームが細くなり(出力 → 0)、最後のインスタンスがフェードし、ハンドルは自身を解放します。
+
+`aim(from, to)` はハンドルを `from` に置き、その +Y を `to` へ向け、`@In0` にエフェクト自身の単位での距離を設定します(スケールした
+ハンドルはそのスケールで割ります)。`options.ignite` / `options.fade`(秒)で出力のランプを設定し、`handle.set_input(index, value)` で
+レシピが bind する他の入力を動かします。火花、蒸気、焦げ跡はワールド空間に放出されるので、薙ぎ払うビームはその経路に沿ってそれらを残します。
+終点は物理のレイキャストから取り、ビームが当たった面で止まるようにします。別の表面着弾が欲しいゲームは、その点で別のエフェクトを再生することもできます。
+
+どのハンドルも、マニフェストの `inputs` の既定値から始め、作られた直後とその後の毎フレームに `inputs` をエミッターへ送り込むので、
+最初のフレームから実際の値が使われます。
+
+## スケールしたエフェクト
+
+`scale` 付きでビルドしたエフェクト(マニフェストの `scale.world`、[scale](scale.md) を参照)は、すでにワールド単位になっています:
+スケール 1 で再生してください。ゲームの Effekseer の上限が怪獣サイズのライブラリに足りること(`project.godot` の `[effekseer]`
+`instance_max_count`、`square_max_count`。Lab は 2000 / 8000 を使用)と、カメラのファープレーンがエフェクトを覆うことを確認してください。
+
+## ソフトパーティクル
+
+`soft` を持つレイヤーは、不透明なジオメトリと接する位置でフェードします。Forward+ レンダラーの深度テクスチャが必要です
+(検証済み。Mobile にも深度テクスチャはありますが未検証)。Compatibility ではほとんど見えなくなります。透明な面(水)は、
+深度を書き込まない限り深度テクスチャに入りません。
## Lab
`vfx showcase`(または `godot --path vfx/godot`)で Lab が開きます:PLAYER と TARGET の 2 体のダミーが向かい合い、すべての
エフェクトがその `delivery` に従って演出されます — `self` は術者に、`melee` は打撃の瞬間にターゲットに、
-`projectile` は術者からターゲットへ飛んで到達時に着弾を、`targeted` はターゲットの上に降らせ、`area` はボスの叩きつけを中心に。
-キー:←/→ 切り替え、Space 再生し直し、C 対戦/単体ステージ、L ループ、P 一時停止、1–4 速度、
+`projectile` は術者からターゲットへ飛んで到達時に着弾を、`targeted` はターゲットの上に降らせ、`area` はボスの叩きつけを中心に、`beam` は術者の砲口からターゲットの手前の地面へ撃ち、その胸へと薙ぎ上げます
+(`delivery.charge` で指定したチャージがあれば、その後で)。ステージは選択したエフェクトの `scale.world` に合わせてスケールします:
+怪獣のエフェクトは 70 m のダミーの間で再生され、カメラも同じ倍率で引かれます。キー:←/→ 切り替え、Space 再生し直し、C 対戦/単体ステージ、L ループ、P 一時停止、1–4 速度、
B 背景、S 自動ショーケース。`-- --no-glow` は比較用に HDR ブルームを無効にします。
ダミーはカプセルです。任意のリグ付き代役で置き換えられます:`player.glb` と `target.glb`(高さ約 1 ユニット、
@@ -47,6 +85,6 @@ Mixamo 形式のボーン名、`idle`、`cast_a_spell`、`box_03`、`hit_to_head
## チェック
-`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` は、現在のマニフェストに対して play、launch、pause、speed、loop、
-自動回収を試験します。`godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd` は
+`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` は、現在のマニフェストに対して play、launch、beam(aim、出力、
+release)、pause、speed、loop、自動回収を試験します。`godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd` は
Godot のランタイムリソースをエクスポートします。これらは実際に実行した後でのみ、合格と報告してください。
diff --git a/docs/ja/references/primitives.md b/docs/ja/references/primitives.md
index 0c2da9f..beda78c 100644
--- a/docs/ja/references/primitives.md
+++ b/docs/ja/references/primitives.md
@@ -17,7 +17,7 @@
## `effect()` のフィールド
-`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None)`
+`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None, hold=None, inputs=None, scale=None)`
| フィールド | 意味 |
|---|---|
@@ -26,8 +26,11 @@
| `duration`, `peak` | 秒。`peak` は Lab のフラッシュ、キック、ターゲットのリアクションが使う接触/解放の瞬間 |
| `attach` | アンカー:`ground`、`body`、`impact`、`caster`、`caster_ground`、`projectile` |
| `impact`, `light` | Lab のステージフラッシュとカメラキックの強さ(0–1)と RGB(デモ演出専用) |
-| `delivery` | ゲームでの演出方法:`SELF`、`MELEE`、`TARGETED`、`dict(kind='area')`、飛翔体そのものには `dict(kind='projectile')`、その着弾には `dict(kind='projectile', projectile='VFX_X')` |
+| `delivery` | ゲームでの演出方法:`SELF`、`MELEE`、`TARGETED`、`dict(kind='area')`、飛翔体そのものには `dict(kind='projectile')`、その着弾には `dict(kind='projectile', projectile='VFX_X')`、保持するビームには `BEAM` または `dict(kind='beam', charge='VFX_X')`(Lab は先にチャージを再生する) |
| `flight`, `arc` | 飛翔体のみ:基準となる飛行の秒数と、山なりの高さ(メートル) |
+| `hold` | ビームのみ:Lab が解放までに照射する秒数。`infinite` のレイヤーはそれまで放出し続ける |
+| `inputs` | `bind` の方程式が読むゲーム入力 `@In0..@In3` の既定値。ビームは `beam_inputs(length)` を使う |
+| `scale` | `'giant'`、`'kaiju'`、数値、または `{'world','time','budget'}`:キャラクタースケールのレシピを、より大きな世界向けにビルドする([scale](scale.md)) |
| `design` | プレイヤーに見えるものを一文で。Lab に表示され、レビュアーに渡される |
## プリミティブ
@@ -60,6 +63,8 @@
| `slice_line` | 解放時の長く細い線 | 35 % から全長まで伸びながら細くなる `T_Streak01`。`width` は見える太さ |
| `spray(end)` / `debris` | 射線に沿った方向のある飛沫、暗く転がる塊 | 回転しない放出 + ワールド方向の `travel` ボックス。重力付きの Blend `T_Shard01`、着地できる |
| `decay(layer, color)` | グロー → 灰色の煙の残像 | Blend のグレーとしてコピーし、`lag` フレーム遅らせ、ライフ × `stretch`、エミッシブなし、流れを遅く |
+| `beam(name, core, body, rim, width=.5, ...)` | ゲームが狙いを付けて薙ぎ払う持続ビーム(ブレス攻撃、レーザー、殺人光線) | 軸固定ビルボード(`YAxisFixed`、根元にピボット)を `bind` で `@In0` まで伸ばし `@In1` で太くする。`T_BeamSection01` の断面、外向きに流れるノイズ、口元と先端のフラッシュ、先端の火花、ワールド空間に残る任意の `steam` と `scorch`([godot](godot.md#ビーム)) |
+| `charge_chain(name, anchors, color, hot, step=4, ...)` | 点の連なりを順に灯していくアーク(背びれ、コイル、レイライン) | アンカーごとに `delay + i*step` でノードのグローとポップ。知覚できないほど小さな速度で次のアンカーへ向けた `DirectionalBillboard` 上のペイント系 `T_ArcStrand01` のアーク。`until` まで `restrike` フレームごとに鏡像で打ち直す |
## ヘルパー
@@ -69,6 +74,8 @@
| `fade(color, alpha=0)` | 同じ RGB で新しいアルファ |
| `POP`, `DISSOLVE` | パッと出てから漂うスケールカーブ。保持(ease-in)してから侵食するカットオフのイージング |
| `sustain(layer, interval)` | 飛翔体のエミッター:解放まで `interval` フレームごとにインスタンスを一つ |
+| `held(layer, interval)` | 持続するクロスフェード:`interval` フレームごとにインスタンスを一つ出し、それぞれ `interval` かけてフェードイン・アウトするので、常に 2 つが重なり合計が一定になる(ループの継ぎ目のない安定したビーム) |
+| `beam_inputs(length, power=1)`, `BEAM_LENGTH`, `BEAM_POWER`, `BEAM` | ビームの既定の入力、その bind の方程式が使う `@In0`/`@In1` の名前、ビームの delivery |
| `TRAIL` | 位置/回転/スケールを生成時にだけ継承:レイヤーは経路上に留まる |
| `slash_set(colors, roll, sweep=(110,260), radius=1.5, offset=(0,0,.5), lean=-18, delay=1, life=14)` | 3 つの幅を持つ一本の刃:2 フレーム遅れる幅広で薄暗い残像、高彩度の本体、細く白熱した縁(`slash_arc`)、屈折の弧、ペイント系のセル調の三日月(`T_Slash02`、刃の平面に置いた `billboard='Fixed'`、計測した `SLASH02_BULGE` で回転)。`colors` = (残像, 本体, 縁) |
| `swing(layers, yaw, pitch=0)` | 刃のレイヤーを `renderer='None'` のピボットで包み、弧が 3D 空間を切り裂くようにする。ヨーを約 ±30–40° にすると、画面上の三日月ではなく楕円に見える |
@@ -77,7 +84,8 @@
## レイヤーフィールド
-PVA、スケール、色のほかに、コンパイラは次をサポートします:`collide`(床での跳ね返り)、`soft`(エンジン規約を参照)、
+PVA、スケール、色のほかに、コンパイラは次をサポートします:`collide`(床での跳ね返り)、`soft`(パーティクルが不透明なジオメトリと接する位置でのフェード距離、ワールド単位。
+Forward+ で検証済み。エンジン規約を参照)、`bind`(ゲーム入力から毎フレーム再計算される位置/スケール。下記参照)、
`size` / `size_end` / `size_curve`(一様なスケール)、`color_end`、`color_curve`、`travel`(イージングした変位)、`spawn`
(球、円、線のエミッター)、`forces`(重力、乱流、渦)、`alpha_texture` + `cutoff` + `edge`
(熱い縁を伴うディゾルブ)、`distortion_texture`、`blend_texture`、`falloff`(フレネル)、`flipbook`、`pivot`、
@@ -85,6 +93,15 @@ PVA、スケール、色のほかに、コンパイラは次をサポートし
キーを列挙します。未知のキーはスペルの候補とともに失敗します。それ以外のものは、レシピに生のプロパティパスとして書くのではなく、
save/open の読み戻しテストとともにコンパイラに追加しなければなりません(手順:[エンジン規約](engine-conventions.md#コンパイラの拡張))。
+### `bind`:ゲームが動かす値
+
+`bind={'position': [x, y, z], 'scale': [x, y, z]}` は、レイヤーの位置またはスケールを、Effekseer の動的方程式がゲーム入力
+`@In0..@In3`(Godot では `handle.set_input()` / `Vfx.beam()`)から **毎フレーム** 再計算する Fixed のベクトルに置き換えます。
+各成分は数値、方程式の文字列(`'@In0'`、`'@In0 * 0.5'`)、または積 `[k, '@In1']` のいずれかで、積の定数 `k` はレシピの
+ワールドスケールに合わせてスケールされ、入力はワールドの値のままです。レシピは、読み取るすべての入力について `inputs=[...]` の既定値を
+与えなければなりません。bind したスケールは `size`/`scale_*` フィールドと、bind した位置は `travel`/`velocity` と組み合わせられません。
+子は bind した親に追従します。
+
## 単位
レイヤーの `life`、`delay`、`interval`:60 FPS のフレーム数。速度と加速度:units per frame。重力:units per frame²。
diff --git a/docs/ja/references/realism.md b/docs/ja/references/realism.md
new file mode 100644
index 0000000..8d31a21
--- /dev/null
+++ b/docs/ja/references/realism.md
@@ -0,0 +1,59 @@
+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/realism.md`](../../../skills/effekseer-vfx/references/realism.md)。エージェントが読み込むのは英語版です。
+
+# 写真調の爆発、炎、煙
+
+ブリーフがスタイライズされた既定の見た目ではなく、リアルな見た目(映画、実写のリファレンス、フォトリアルなゲーム)を求めるときに使います。
+クラフトルール — 時間構造、明度の階層、形の変化 — はそのまま適用されますが、色、明るさ、テクスチャは写真から取ります。
+
+## 写真から取る色と明るさ
+
+燃料や弾薬の爆発を撮った昼間の写真とハイスピード映像は、次の値で一致します(sRGB、Lab のブルーム適用前)。
+これらは `VFX_Kaiju_Explosion` のパレットです:
+
+| 役割 | RGB | 補足 |
+|---|---|---|
+| 接触のコア | 255, 244, 214 | 淡い黄白色で、純白 **ではない**。短いスパイク一回で、Lab のフレームで約 8 までに消える |
+| 炎の本体 | 255, 168, 72 | オレンジ。接触の後は本体が最も明るい部分 |
+| 冷めていく縁 | 214, 84, 28 | 炎が煤と接するところの深い赤橙 |
+| 最後の残光 | 120, 40, 18 → 60, 20, 10 | 煙の内側にくすんだ赤い溜まりが残り、やがて消える |
+| 煤 | 38, 32, 29 | 暖かみのある黒に近い色で不透明:炎はその手前で燃える |
+| 煙の柱 | 92, 84, 78 | 茶色がかった灰色。日の当たる上部は明るく、下側は暗い |
+| 土埃のスカート | 150, 136, 118 | 地面の色で、煙より明るい |
+| 蒸気 | 205, 215, 225 | ほぼ白で薄く、速く昇って消える |
+
+- **炎にピンクやマゼンタを使わない。** 彩度の高い赤ピンク(R と B が高い)は、ひと目でゲームのエフェクトに見えます。
+- **炎が白いのは長くない。** 写真では白熱したフレームは 1〜2 フレームで、その後最も明るいピクセルは黄橙色です。Lab のブルームの下では、
+ 長いライフの 10 % にわたって白に近いままのランプは白飛びしたフラッシュに見えます(独立レビューがまさにそれを指摘しました)。
+ 約 5 % からオレンジにします。
+- **煙は炎よりずっと長く残り**、ゆっくり動きます:実際の爆発では火球は 1 秒ほどで消え、柱はその後何秒も昇り続けます。
+ 密度を保ち(colour_end のアルファを 0 より上に)、煙が消えてしまった後ではなく、まだ目に見えて薄れつつあるうちにエフェクトを終えます。
+- **煙は上から照らされる。** 写真調の煙のシートは上部が明るく下側が暗いので、ロールは小さく(±12°)して光が上に留まるようにし、
+ `spawn rotate=False` で放出して `velocity` がワールドの上向きになるようにします。
+- エミッシブ:加算の炎には 1.3〜1.8 で十分です。それより明るい値は本体をブルームのしきい値の上に押し上げ、白くなってしまいます。
+ 説得力を生むのは明度の構造(淡いコア、オレンジの本体、暗い煤)であって、生の強度ではありません。
+
+## テクスチャ
+
+ペイント系のスタイライズされたひと吹きは、フォトリアルな世界の中ではカートゥーンに見えます。このスキルは写真調のフリップブックを 3 枚同梱しています
+(4×4、1024²、画像モデルで生成して処理済み。プロンプトは `assets/examples/texture_prompts.json`):
+
+| テクスチャ | 用途 | ブレンド |
+|---|---|---|
+| `T_FireballSheet01` | 火球:アルファ = 輝度なので、熱い溜まりが光り、煤は透明になる | Add、`ramp` 付き |
+| `T_FireballSootSheet01` | 同じ火球の不透明な本体(陰影のある灰色、シルエット全体) | Blend、炎より **前に** リストする |
+| `T_SmokeSheet02` | 上部が照らされた、写真調の転がる煙の柱 | Blend、煙の色で色付け |
+
+`smoke()` はどの `T_*Sheet*` テクスチャも 4×4 のフリップブックとして再生します。最後まで濃いままでなければならない柱には、フリップブックを遅くして
+(`flipbook=dict(x=4, y=4, frame_length=8, loop='Once')`)、シートの最後のほぼ空のセルに届く前に止まるようにします。
+
+## 地面と接する煙と炎
+
+床や水面を貫くスプライトは、硬い水平の線を残します。地面の煙、土埃、蒸気には `soft` の距離(ワールド単位で、ひと吹きのサイズの
+3 分の 1 から半分)を与えます — Forward+ で検証済みです。[エンジン規約](engine-conventions.md#レンダリングhdrlab) を参照してください。
+
+## 写真調の爆発のレイヤー計画
+
+奥から手前へ:陽炎 → 煙の柱(soft、遅いフリップブック)→ 煤の本体(Blend)→ 火球(Add、写真調の
+ランプ)→ そこから投げ出される炎の塊 → 接触のフラッシュと短いブルーム → 柔らかい土埃のスカートが転がり出る地面のピボット →
+地面の衝撃リングと屈折 → 火花の段 → 着地する暗い破片。`vfx examples show VFX_Kaiju_Explosion` で
+タイムラインを表示できます。
diff --git a/docs/ja/references/scale.md b/docs/ja/references/scale.md
new file mode 100644
index 0000000..d84370e
--- /dev/null
+++ b/docs/ja/references/scale.md
@@ -0,0 +1,94 @@
+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/scale.md`](../../../skills/effekseer-vfx/references/scale.md)。エージェントが読み込むのは英語版です。
+
+# ワールドスケール:巨人、怪獣、軍艦
+
+目次:スケールは大きさだけではない · スケールの宣言 · 変換されるもの · スケールしたレシピの書き方 · スケール時の Lab ·
+レシピに合わせてスケールするチェック · スケールしたエフェクトをゲームで使う · 検証方法
+
+## スケールは大きさだけではない
+
+このスキルのプリミティブ、既定値、クラフト上の数値はすべて、1 ユニット = 1 m の世界にいる約 1.75 m のキャラクター向けに調整されています:
+火花は 0.0015 units/frame² で落ち、接触は 2〜5 フレーム続き、Lab のアンカーは 0.95 m と 1.35 m にあります。身長 70 m の
+怪獣には、同じエフェクトが 40 倍大きく、そして **遅く** 必要です。キャラクタースケールのタイミングのまま拡大した爆発は、
+テーブルの上のミニチュアに見えます:破片は 1 秒で 40 m 落ち、煙はカップから立つ湯気のように沸き立ちます。映画の模型制作者が
+ミニチュアをハイフレームレートで撮影するのも同じ理由です(フルード相似則:時間は大きさの平方根に比例して伸びます)。
+
+ゲームや映画はそこまで徹底しません:sqrt(40) ≈ 6.3 倍にすると、怪獣の爆発は 10 秒続き、ブレス攻撃は鈍重に感じられます。
+以下のプロファイルは時間をおよそ world^0.25 倍に伸ばすので、40 倍のエフェクトは 2.5 倍長く続きます。
+
+## スケールの宣言
+
+レシピは Lab のキャラクタースケールで書き、`effect()` に `scale` を追加します:
+
+```python
+return effect('Kaiju_Explosion', 'Kaiju Explosion', 'explosion', 'fire', 2.3, [...], scale='kaiju')
+```
+
+| `scale` | world | time | budget | 用途 |
+|---|---|---|---|---|
+| `'character'`(既定) | 1 | 1 | 1 | 人、約 3 m までのクリーチャー |
+| `'giant'` | 8 | 1.7 | 2 | 10〜20 m の巨人、攻城兵器、メカ |
+| `'kaiju'` | 40 | 2.5 | 3 | 50〜100 m の怪獣、軍艦、都市規模の打撃 |
+| 数値、例:`16` | 16 | 16^0.25 = 2.0 | 16^0.3 | 独自の大きさ。time と budget はカーブに従う |
+| `{'world': 40, 'time': 1.5, 'budget': 2}` | 指定どおり | 指定どおり | 指定どおり | 正確なプロファイル(怪獣をもっと速くしたいゲーム) |
+
+`effect()` はレシピをその場で変換し、プロファイルを `recipe['scale']` に記録します。マニフェストもそれを持つので、Lab と `Vfx.gd` は
+エフェクトの大きさを知ることができます。ブリーフの `beats` と、レビューで読むすべてのフレームは、**ビルド後**(変換後)のタイムラインの
+フレームです:フレーム 4 に書いた接触は、怪獣のストリップではフレーム 10 にあります。
+
+## 変換されるもの
+
+| グループ | フィールド | 変換 |
+|---|---|---|
+| 時間 | `life`、`delay`、`interval`、`fade_in`、`fade_out`、`flipbook.frame_length`。エフェクトの `duration`、`peak`、`flight`、`hold` | × time(`life` とフレーム長は整数フレームに切り捨てるので、伸ばした duration より長生きするものはない) |
+| 速さ | `uv_scroll`、`alpha_scroll`、`distortion_scroll`、`blend_scroll`、`spin` | ÷ time |
+| ノードのスケール | `size`、`size_end`、`scale_start`、`scale_end`(どれもないレイヤーには `scale_start=[world]*3`) | × world |
+| 位置 | `position`、`travel.start/end`、`spawn.radius/start/end/noise`、力の `position` | × world |
+| モーション | `velocity`、乱流/渦の `power` | × world ÷ time |
+| 加速度 | `acceleration`、重力の力 | × world ÷ time² |
+| ワールド座標 | `collide.height`、`soft` | × world、すべての階層で |
+| `bind` | 数値と `[k, '@In1']` の定数 | × world。方程式の文字列(`'@In0'`)はゲームが与えるワールドの値なのでそのまま |
+| エフェクト | `arc` | × world |
+
+空間的にスケールされるのは **トップレベルのレイヤー** だけです:子は親の座標系の中にあり、それはすでにスケールされているので、
+変わるのは時間とワールド座標のフィールドだけです。`inherit={'scale': 'NotBind'}` の子は再びワールド単位で存在するので、
+トップレベルのレイヤーと同じようにスケールされます。Ring とプロシージャルメッシュのジオメトリはノードのスケールの内側にあるので、何もする必要はありません。
+
+## スケールしたレシピの書き方
+
+- 考えるのも調整するのもキャラクタースケールで行います:他のサンプルで知っているアンカー、サイズ、速さはそのまま当てはまります。
+ ストリップは 1 倍版ではなく、変換後のエフェクトのものを読みます。
+- 怪獣のエフェクトは大部分が **質量** です:煙と土埃のボリュームを増やし、二次モーションを遅く、消散を長く、破片は数を減らして大きく。
+ 予算の倍率は密度のためのもので、ノイズを増やすためのものではありません。
+- 表面に触れなければならないもの(土埃のスカート、地面の炎)にはワールドの高さが必要です:いつもどおり Lab のアンカーからの相対値で書けば
+ (`impact` アンカーの下なら `floor = -1.3`)、変換がそれをスケールします。
+- ペイント系テクスチャの解像度は変わりません:画面上で 100 m を覆う 1024² のフリップブックはぼやけます。大きな形を持つ写真調のシートを優先し
+ ([realism](realism.md) を参照)、巨大なカード 1 枚ではなく 2〜3 個のひと吹きを積み重ねます。
+
+## スケール時の Lab
+
+Lab は選択したエフェクトの `scale.world` を読み、ステージ全体をワールド原点を中心にスケールします:台、床、ダミー(怪獣スケールでは
+70 m のカプセル)、カメラの位置、ニア/ファープレーン、影の距離、ステージのフラッシュ(ライトのエネルギーは距離とともに増やす。
+Godot のオムニライトは 1/距離 で減衰する)、カメラキック。フレーミングはキャラクタースケールのストリップと同一なので、レビューの指標
+(ステージの高さを単位に計測)もレビュアーの目も、スケールをまたいで比較できます。サブタイトルには `KAIJU x40` と表示されます。
+
+## レシピに合わせてスケールするチェック
+
+| チェック | スケールの係数 |
+|---|---|
+| lint のパーティクル予算 | × budget |
+| lint の重力の上限(1 倍で 0.01 units/frame²) | × world ÷ time² |
+| lint の接触フラッシュの長さ、接触レイヤーのライフ、ピークの許容差 | × time |
+| review のフラッシュの期間、ピーク外の許容差、空のテールの最小値 | × time |
+
+## スケールしたエフェクトをゲームで使う
+
+`.efk` はワールド単位でビルドされています:スケール 1 で再生し(`Vfx.play(id, position)`)、エミッターを再度スケールしてはいけません。
+マニフェストの `scale` エントリは、ゲーム(と Lab)にとっての参考情報です。ビームの `@In0` の長さはワールドの距離なので、
+`Vfx.beam()` はどのスケールでも同じように動作します。
+
+## 検証方法
+
+`scale={'world': 40, 'time': 1}` でビルドした `VFX_Fire_Explosion` のコピーを、スケールした Lab で元のものと並べてレンダーしました:
+フレームはピクセルあたり平均 4〜6/255 以内で一致し(ランダムな火花とブルームは異なる)、空間の変換が 40 倍でもエフェクトを正確に再現することが
+確かめられました。時間の伸ばし方はデザイン上の選択で、怪獣のサンプル(`vfx examples add kaiju`)で独立レビューによって判断されています。
diff --git a/docs/zh/README.md b/docs/zh/README.md
index 4946bd5..0b8b891 100644
--- a/docs/zh/README.md
+++ b/docs/zh/README.md
@@ -28,7 +28,9 @@
| [review.md](references/review.md) | 复查循环、证据与交付:review 产出、flag 含义、阅读连拍、独立评审、`effect-verify` |
| [cases.md](references/cases.md) | 诊断案例:火焰爆炸、飞行体烟尾、护盾破碎三个重建的前后对照案例,附真实渲染对照图 |
| [cli.md](references/cli.md) | 命令参考:所有 `vfx` 命令、所需环境和工作区结构 |
-| [examples.md](references/examples.md) | 随附示例:火、冰、毒、暗四组飞行体 + 命中配对,以及命中、斩击、蓄力、护盾、治疗五个单独效果及其用法 |
-| [godot.md](references/godot.md) | 在 Godot 中使用效果:`Vfx` API、Lab 操作、替身角色和运行时检查 |
-| [engine-conventions.md](references/engine-conventions.md) | 已验证的引擎约定:角度与坐标轴、力、网格与 fresnel、序列帧、继承、HDR 与 Lab、锚点、扩展编译器 |
-| [primitives.md](references/primitives.md) | 配方代码与基元:`effect()` 字段、基元表、辅助函数、层字段和单位 |
+| [examples.md](references/examples.md) | 随附示例:火、冰、毒、暗四组飞行体 + 命中配对,命中、斩击、蓄力、护盾、治疗五个单独效果,以及怪兽套组及其用法 |
+| [godot.md](references/godot.md) | 在 Godot 中使用效果:`Vfx` API、光束、放大的效果、软粒子、Lab 操作、替身角色和运行时检查 |
+| [engine-conventions.md](references/engine-conventions.md) | 已验证的引擎约定:角度与坐标轴、力、网格与 fresnel、序列帧、继承、游戏输入与动态方程、HDR 与 Lab、锚点、扩展编译器 |
+| [primitives.md](references/primitives.md) | 配方代码与基元:`effect()` 字段、基元表、辅助函数、层字段(含 `bind`)和单位 |
+| [scale.md](references/scale.md) | 世界尺度:巨人、怪兽、战舰的 `scale` 档位、哪些字段会换算、放大后的 Lab 和检查 |
+| [realism.md](references/realism.md) | 照片级的爆炸、火焰和烟:来自照片的颜色与亮度、照片级序列帧、与地面相接的 soft、层计划 |
diff --git a/docs/zh/SKILL.effekseer-vfx.md b/docs/zh/SKILL.effekseer-vfx.md
index d7f588b..e81e6b6 100644
--- a/docs/zh/SKILL.effekseer-vfx.md
+++ b/docs/zh/SKILL.effekseer-vfx.md
@@ -20,7 +20,7 @@
`doctor` 的 `next` 会打印适合本机的确切命令。
setup 需要 Python 3.11+ 或 uv(macOS 自带的 Python 3.9 太旧);如果 `doctor` 报告两者都没有,请用户安装其中一个。Godot 4(Forward+)必须由用户自行安装;如果它不在 `PATH` 上,设置 `GODOT`。
3. `vfx init` 创建 `vfx/`(Godot Lab、材质、数学纹理、官方 Effekseer 插件)。除非加 `--update-templates`,否则不会覆盖已有文件。
-4. 可选:`vfx examples add <name>` 复制一个完成且经过独立评审的示例用于学习:配对 `fire`、`ice`、`poison`、`dark`(飞行体 + 命中),单独效果 `hit`、`slash`、`charge`、`shield`、`heal`,或 `all`。见 [references/examples.md](references/examples.md)。
+4. 可选:`vfx examples add <name>` 复制一个完成且经过独立评审的示例用于学习:配对 `fire`、`ice`、`poison`、`dark`(飞行体 + 命中),单独效果 `hit`、`slash`、`charge`、`shield`、`heal`,套组 `kaiju`(世界尺度、光束、蓄力链、照片级爆炸),或 `all`。见 [references/examples.md](references/examples.md)。
`vfx review`、`preview` 和 `showcase` 会在用户桌面上打开 Godot 窗口。如果你运行在沙箱里(例如 Codex 的工作区沙箱),
请在用户批准后到沙箱外运行这些命令;无法离开沙箱时,把完整命令交给用户在自己桌面的终端里运行。以 "rendered no frame" 停止的 review
@@ -31,7 +31,7 @@
## 制作或修改一个效果
-1. **先读再写。** 必读 [craft](references/craft.md)、[design](references/design.md)、[layering](references/layering.md)、[timing](references/timing.md) 和 [skeletons](references/skeletons.md);再按下面的路由表读对应主题文件,并用 `vfx examples show <name>` 查看对应示例的层计划(名称:`hit`、`slash`、`charge`、`shield`、`heal`,飞行体和爆炸等命中效果用配对 `fire`、`ice`、`poison`、`dark`;也可以直接用效果 ID)。修改已有效果时运行 `vfx effect-context <ID>` 并阅读它的历史,避免重复已经失败的改法。
+1. **先读再写。** 必读 [craft](references/craft.md)、[design](references/design.md)、[layering](references/layering.md)、[timing](references/timing.md) 和 [skeletons](references/skeletons.md);再按下面的路由表读对应主题文件,并用 `vfx examples show <name>` 查看对应示例的层计划(名称:`hit`、`slash`、`charge`、`shield`、`heal`,飞行体和爆炸等命中效果用配对 `fire`、`ice`、`poison`、`dark`,大尺度、光束和写实效果用 `kaiju`;也可以直接用效果 ID)。修改已有效果时运行 `vfx effect-context <ID>` 并阅读它的历史,避免重复已经失败的改法。
2. **简报。** 编写 `vfx/briefs/<ID>.json`(三个关键画面、调色板职责、节拍、层计划、验收条件、避免事项)。格式见 [design.md](references/design.md)。
3. **纹理。** `init` 之后已经有数学形状(光晕、环、噪声、拖尾、扰动图),以及一套入门用的手绘烟、爆炸、丝状笔触、裂纹和冰纹理。复杂的手绘形状(火焰、斩击、烟、裂纹、冰、符文)来自图像生成模型 —— 按 [textures.md](references/textures.md) 操作。使用任何纹理的角度之前,先用 `vfx texture-info` 实测。
4. **配方。** 编写 `vfx/src/<ID>.py`,用 [primitives.md](references/primitives.md) 中的基元定义 `recipe()`。坐标轴、单位和混合行为遵循 [engine-conventions.md](references/engine-conventions.md) 中已实测的引擎规则,不要猜。
@@ -50,6 +50,7 @@
- 不要用 Python 画复杂的手绘形状。如果没有图像生成工具,把提示词写进 `vfx/texture_prompts.json`,向用户索要图片。
- 生成的原图保留在 `vfx/textures/generated/`,处理后的副本写到 `vfx/textures/processed/`;记录每一条提示词。
- 单位:配方 timing 是 60 FPS 帧数,F-Curve 是生命周期百分比,manifest 的 duration/peak 是秒,Godot API 的 rotation 是弧度。
+- 按 Lab 的角色尺度编写配方;更大的世界要声明 `scale`,而不是手动缩放数值([scale](references/scale.md))。简报和复查中的帧号是构建后、已缩放的时间线上的帧。
- 每个效果都声明 `delivery`;飞行体需要一个反向指向它的配对命中效果。
- 只使用编译器认识的层字段(`vfx layer-schema`);需要新功能时扩展编译器,不要把裸属性路径写进配方。
- 全量 `vfx build`(不带 `--ids`)会清除由本技能构建、但源码已离开 `vfx/src/` 的效果的产物;它绝不删除不是它构建的效果,并且拒绝在空的效果库上运行。只做局部工作时用 `--ids`(其他地方损坏的源码会列在 `unloaded` 中,而不会阻塞它)。
@@ -63,6 +64,9 @@
| 斩击、飞行体、蓄力、光环,任何会移动的东西 | [motion.md](references/motion.md) |
| 护盾、光柱、Boss、状态、体积、遮挡 | [shapes.md](references/shapes.md) |
| 对照参考视频 | [reference.md](references/reference.md) |
+| 巨人、怪兽、战舰:任何远大于角色的东西 | [scale.md](references/scale.md) |
+| 光束、激光、吐息武器、蓄力链、由游戏在运行时驱动的值 | [primitives.md](references/primitives.md)(`beam`、`charge_chain`、`bind`)、[godot.md](references/godot.md#光束) |
+| 写实 / 照片级的爆炸、火焰、烟、蒸汽 | [realism.md](references/realism.md) |
| 具体的视觉失败(白团、尾段空白、没有破碎) | [cases.md](references/cases.md) |
| 给编译器添加引擎功能 | [engine-conventions.md](references/engine-conventions.md#扩展编译器)、`vfx discover`、`vfx core property-list/get/set` |
| 在游戏中使用效果 | [godot.md](references/godot.md) |
diff --git a/docs/zh/references/cli.md b/docs/zh/references/cli.md
index 38cd012..6a146fd 100644
--- a/docs/zh/references/cli.md
+++ b/docs/zh/references/cli.md
@@ -23,9 +23,9 @@
|---|---|---|
| `doctor` | — | 平台、工具链、工作区;`modes` 和 `next` 步骤 |
| `init [--update-templates] [--no-plugin]` | Python | 创建/刷新 `vfx/`(Lab、材质、数学纹理、入门手绘纹理);下载官方 Effekseer Godot 插件(固定校验和) |
-| `examples [list]` | — | 随附的配对和单独效果,以及它们的历史分数、结论和最弱项 |
-| `examples show <name\|ID>` | Python | 带绝对帧号和职责的层计划(配对会同时显示两个效果) |
-| `examples add <name\|ID\|all> [--force]` | Python | 把示例源码、简报、手绘纹理和提示词复制到项目中;名称:`fire`、`ice`、`poison`、`dark`、`hit`、`slash`、`charge`、`shield`、`heal` |
+| `examples [list]` | — | 随附的配对、单独效果和套组,以及它们的历史分数、结论和最弱项 |
+| `examples show <name\|ID>` | Python | 带绝对帧号和职责的层计划(配对或套组会显示其中每个效果) |
+| `examples add <name\|ID\|all> [--force]` | Python | 把示例源码、简报、手绘纹理和提示词复制到项目中;名称:`fire`、`ice`、`poison`、`dark`、`hit`、`slash`、`charge`、`shield`、`heal`、`kaiju` |
| `procedural` | Python | 重新生成数学基元纹理 |
| `list` | Python | `vfx/src` 中的效果及其类别、时间、delivery、design 和构建状态;加载失败的源码列在 `unloaded` 中 |
| `lint [--ids ...] [--timeline]` | Python | 静态规则(error)和制作启发式(warning),见下文 |
diff --git a/docs/zh/references/engine-conventions.md b/docs/zh/references/engine-conventions.md
index b8ae401..389b464 100644
--- a/docs/zh/references/engine-conventions.md
+++ b/docs/zh/references/engine-conventions.md
@@ -3,7 +3,8 @@
下面每一条都在真实渲染中确认过。照原样使用;不要重新猜坐标轴、单位或混合行为。确认了新的约定时,把它连同测量方法一起补充到这里
(请补充到英文原文 `skills/effekseer-vfx/references/engine-conventions.md`)。
-目录:角度与坐标轴 · 力与运动 · 网格与 fresnel · 纹理与序列帧 · 继承与寿命 · 渲染、HDR 与 Lab · 锚点与放置 · 扩展编译器
+目录:角度与坐标轴 · 力与运动 · 网格与 fresnel · 纹理与序列帧 · 继承与寿命 · 游戏输入与动态方程 · 渲染、HDR 与 Lab · 锚点与放置 ·
+扩展编译器
## 角度与坐标轴
@@ -16,6 +17,13 @@
- **`rotate=True` 的圆形发射(默认 Y 轴)不同**:Core 构造的是 `Translation(r,0,0)*RotationY(angle)`,所以局部 **+X** 指向外侧,
+Y 仍然向上。沿地面向外滚动的烟需要 `travel.end=[[d0,d1],0,0]`;`[0,d,0]` 会把它变成笔直上升的柱子。`rotate=False` 时位移按世界方向计算
(上升的粒子用它)。
+- **`rotate=True` 的球形发射也会旋转 PVA `velocity`**:`velocity=[0, v, 0]` 沿每个粒子随机的出生方向飞,而不是向上。
+ 这样发射的烟柱向侧面漂移并下沉(复查的 `sinks` flag);`spawn=dict(shape='Sphere', radius=[...], rotate=False)` 让 `velocity`
+ 保持世界方向。
+- **轴向 billboard**:`billboard='YAxisFixed'` 配 `pivot='bottom'` 是一张从原点沿局部 +Y 延伸的面片,绕该轴旋转以面向镜头 ——
+ 这样的光束从任何角度看都保持宽度,只有正对着它的轴看时除外。`DirectionalBillboard` 让 +Y 对齐粒子的运动方向;
+ 配一个察觉不到的速度(1e-4 单位/帧,`charge_chain`),它不用欧拉角就能把一个静止的 sprite 瞄准任意点(实测:在弯曲脊背上的
+ 7 点链中,电弧连上了每一个锚点)。
- **`travel.end` 是绝对的局部位置**,不是相对 `position` 的偏移,而且 `rotate=True` 的发射也会旋转这个局部坐标系。
把沿地面滚动的烟放在一个 `renderer='None'`、`position` 位于地面高度的枢轴下;需要按世界方向位移时用 `spawn rotate=False`(`spray`)。
@@ -77,6 +85,18 @@
- **随机尺寸不能配曲线**:随机的 `size` / `scale_start` 范围与 `size_curve` / `scale_curve` 组合会编译失败(编译器把曲线乘以固定的起始缩放;
lint 会拒绝)。用第二层来变化尺寸。
+## 游戏输入与动态方程
+
+- **`bind` 在 Godot 插件中于运行时生效。** 带动态方程(`@O.y = @In0`)的 Fixed 位置或缩放每帧都会重新计算:一个探针在正在播放的
+ handle 上把 `@In0` 从 3 改到 9 再改到 5,光束的长度和末端闪光在 2 帧内跟上;旋转发射器会重新瞄准它。编译器把方程写进
+ `Core.Dynamic.Equations`(相同的代码共用一条),并在 save/open 之后检查它们。
+- **新 handle 从 .efk 中的输入默认值开始**(配方的 `inputs`):在第一帧模拟时,怪兽光束命中点的喷溅出现在默认的 160 m 处,
+ 而不是真实的终点。因此 `Vfx.play()` / `Vfx.beam()` 在创建 handle 后立刻推送它的输入,`CombatVfxHandle` 之后每帧再推送一次。
+ (早期探针看到 0,只是因为它的 .efk 没有保存默认值。)
+- **持续主体**:光束主体是一个 `held()` 交叉淡化(每个间隔一个实例,寿命 2×间隔,淡入淡出各一个间隔),而不是一个长寿命的实例,
+ 所以 `release()`(`stop_root()`)能按时结束它:在连拍中,怪兽光束在释放后约 15 帧内变细并消失,`TestApi.gd` 会检查
+ 释放后的光束会自行释放。
+
## 渲染、HDR 与 Lab
- **屏幕扭曲 `material='BackDistortion'`** 在 Godot 插件中可用(`hint_screen_texture`);`distortion` 是强度(0.4–1.2)。
@@ -90,8 +110,14 @@
在改变舞台亮度、假人光照或替身角色之后,先重新测量假人峰值(线性 tonemap,在曝光 1/8 下读回),再移动阈值。`godot --path vfx/godot -- --no-glow` 关闭后处理以便对比。
配方基元 `glow()` 是一个纹理层,不是这个 HDR 后处理。舞台改动之后重新渲染整个总览。
- 在强泛光下,接触本来就该白热的效果会在峰值帧报告 `washed out`;它只持续 1–3 帧 —— 看连拍判断,不要为了消掉这个 flag 而削弱接触。
-- **软粒子 `soft`** 在早期的 Compatibility 渲染器 Lab 中不可用(没有深度纹理;sprite 几乎完全透明)。Lab 现在使用 Forward+,
- 但 `soft` 尚未重新验证:不要使用,也不要声称它可用。
+- **软粒子 `soft` 在 Forward+ 中可用**(EffekseerForGodot4 1.80.5.1、Godot 4.7.2)。插件的着色器采样 `hint_depth_texture`,
+ 在不透明深度前方 `soft` 个世界单位的范围内让粒子淡出。在半埋进 Lab 地面、开启深度测试的卡片上实测:没有 `soft` 时,
+ 亮度在地面线处一个像素内从 206 降到 81;`soft=0.3` 时在约 9 个像素内渐变为 198 → 188 → 169 → 124 → 81;悬在空中的卡片
+ 有无 `soft` 颜色完全相同(216, 198, 155)。接近粒子尺寸的 `soft` 会让整张卡片淡出(lint 会警告)。深度纹理中只有不透明几何体:
+ 透明的水面必须写入深度(或有一个不透明的深度预渲染 pass),烟才能在它上面柔化。Compatibility 渲染器没有深度纹理:
+ 在早期的 Lab 中,`soft` 在那里让 sprite 几乎完全透明 —— 不要在 Compatibility 下使用它。
+- **放大后的舞台闪光**:Godot 的 omni 光按 1/距离衰减(attenuation 1),所以 Lab 把闪光能量乘以舞台缩放,而不是它的平方
+ (用平方时,一次怪兽命中把整个舞台都冲白了)。
## 锚点与放置
diff --git a/docs/zh/references/examples.md b/docs/zh/references/examples.md
index 9c44eaa..476e079 100644
--- a/docs/zh/references/examples.md
+++ b/docs/zh/references/examples.md
@@ -1,6 +1,6 @@
# 随附示例
-四组远程配对(一个飞行体加上在它到达处播放的命中效果)和五个单独效果,每个常见类别各一个。它们是完整的成品配方,附有设计简报、
+四组远程配对(一个飞行体加上在它到达处播放的命中效果)、五个单独效果(每个常见类别各一个)以及怪兽套组。它们是完整的成品配方,附有设计简报、
手绘纹理(处理后的副本)以及生成它们的提示词。它们的层职责就是 [skeletons](skeletons.md) 中的类别骨架。
| 配对 | 飞行体 | 命中 | 能学到什么 |
@@ -18,9 +18,16 @@
| `shield` | `VFX_Shield_Dome` | fresnel 壳和细边缘、过冲弹出、带扫描带的保持段、按时清空的 `shell_fragments` 破碎 |
| `heal` | `VFX_Heal` | 没有冲击帧:地面法阵、滚动的光柱、环、全部上升并缓出的加号和光点 |
+| 套组 | 效果 | 能学到什么 |
+|---|---|---|
+| `kaiju` | `VFX_Kaiju_Atomic_Charge`、`VFX_Kaiju_Atomic_Beam`、`VFX_Kaiju_Explosion` | `scale='kaiju'`(构建时放大 40 倍、放慢 2.5 倍,[scale](scale.md));沿假人背部攀升的 `charge_chain()`;由游戏输入驱动、可以扫动的 `beam()`,身后留下蒸汽和焦痕;带烟灰、上升烟柱和柔和地面尘埃的照片级爆炸([realism](realism.md)) |
+
+怪兽套组在 70 m 高的假人之间演出(Lab 会随效果缩放舞台),它的光束在蓄力之后发射,从目标前方的地面扫到目标胸口。
+
```sh
vfx examples # list with historical scores and verdicts
vfx examples show slash # layer plan, absolute frames, roles, budget (a pair shows both effects)
+vfx examples add kaiju # a set: the charge, the beam and the explosion
vfx examples add fire # copy into vfx/src, vfx/briefs, vfx/textures/processed, vfx/texture_prompts.json
vfx lint --ids VFX_Projectile_Fire VFX_Fire_Explosion
vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion
@@ -28,11 +35,12 @@ vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"
```
(`vfx examples` 列出示例及其历史分数和结论;`examples show` 显示层计划、绝对帧号、职责和预算(配对会同时显示两个效果);
-`examples add fire` 复制到 `vfx/src`、`vfx/briefs`、`vfx/textures/processed` 和 `vfx/texture_prompts.json`。)
+`examples add kaiju` 添加一个套组:蓄力、光束和爆炸;`examples add fire` 复制到 `vfx/src`、`vfx/briefs`、`vfx/textures/processed` 和 `vfx/texture_prompts.json`。)
历史分数(每个评分项 0–3)来自对本技能默认胶囊 Lab 中渲染的一次独立评审:两位评审只看了连拍图、关键帧拼图、manifest 条目和 flags。
其中十一个被判为 `ship`;`VFX_Projectile_Ice`(扁平的冰枪,没有白色核心或暗边,飞行中形状不变)和 `VFX_Projectile_Dark`
-(到达之后路径上什么都不留)被判为 `iterate`。`vfx examples` 列出每个示例最弱的评分项和评审给出的一条修法(`historical_review.worst`)。
+(到达之后路径上什么都不留)被判为 `iterate`。怪兽套组以同样方式、在放大的 Lab 中对其自身渲染做了独立评审,经过数轮修改后三个都被判为
+`ship`(评审给出的修法:背板贴在身体上、逐块点亮的晶体背鳍、向嘴部汇聚的电光、阴燃烟以及比火焰活得更久的烟柱,用来填满收尾)。`vfx examples` 列出每个示例最弱的评分项和评审给出的一条修法(`historical_review.worst`)。
这些分数只是参考,**不是**对你的构建的验证:要重新构建、复查并再次评分。添加示例时除非加 `--force`,否则绝不覆盖已有文件。
要从示例制作新效果,把源码复制为新 ID(重命名文件和 `effect('...')` 中的名称,以及简报的 `effect_id`),然后改变形状、运动和节奏 ——
diff --git a/docs/zh/references/godot.md b/docs/zh/references/godot.md
index e76d4bf..190b84b 100644
--- a/docs/zh/references/godot.md
+++ b/docs/zh/references/godot.md
@@ -25,14 +25,50 @@ shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))
`options.arc` 让它抬升。
有限时长的效果在 `duration` 之后自行清理;循环效果一直重播,直到 `stop()`。manifest(`vfx_manifest.json`)包含 `id`、`duration`、
-`peak`、`impact`、`light`、`delivery`、`flight`、`arc`、`attach` 和 `design`;Lab 用 `impact`/`light`/`peak` 驱动舞台闪光和镜头抖动,
-这些需要你的游戏自己实现。
+`peak`、`impact`、`light`、`delivery`、`flight`、`arc`、`hold`、`inputs`、`scale`、`attach` 和 `design`;Lab 用 `impact`/`light`/`peak`
+驱动舞台闪光和镜头抖动,这些需要你的游戏自己实现。
+
+## 光束
+
+用 `beam()` 构建的配方(manifest 中 `delivery.kind == "beam"`)是一个持续效果,它的长度和功率由游戏通过其 `bind` 方程读取的输入来驱动
+(`@In0` 是以世界单位计的长度,`@In1` 是 0–1 的功率):
+
+```gdscript
+var ray = Vfx.beam("VFX_Kaiju_Atomic_Beam", mouth.global_position, target_point) # ignites: power 0 -> 1
+func _process(_delta):
+ if is_instance_valid(ray) and not ray.released:
+ ray.aim(mouth.global_position, raycast_hit_point) # every frame: sweep, follow the head, stop at walls
+# when the breath ends:
+ray.release() # the beam narrows (power -> 0) and its last instances fade; the handle frees itself
+```
+
+(`Vfx.beam()` 点燃光束,功率 0 -> 1;每帧调用 `aim()`:扫动、跟随头部、停在墙上;吐息结束时调用 `release()`:光束变细(功率 -> 0),
+最后的实例淡出,handle 自行释放。)
+
+`aim(from, to)` 把 handle 放在 `from`,把它的 +Y 转向 `to`,并把 `@In0` 设为以效果自身单位计的距离(缩放过的 handle 会除以它的缩放)。
+`options.ignite` / `options.fade`(秒)设置功率的渐变;`handle.set_input(index, value)` 驱动配方绑定的任何其他输入。火花、蒸汽和焦痕
+在世界空间中发射,所以扫动的光束会沿路径留下它们。让终点来自物理射线检测,光束就会停在它击中的表面上;想要单独表面命中效果的游戏,
+仍然可以在该点再播放一个效果。
+
+每个 handle 从 manifest 的 `inputs` 默认值开始,创建后立刻、之后每帧都把它的 `inputs` 推送给发射器,所以第一帧就用上真实的值。
+
+## 放大的效果
+
+用 `scale` 构建的效果(manifest 的 `scale.world`,见 [scale](scale.md))已经是世界单位:以缩放 1 播放它。确保游戏的 Effekseer 上限
+能容纳怪兽尺寸的效果库(`project.godot` 中 `[effekseer]` 的 `instance_max_count`、`square_max_count`;Lab 用 2000 / 8000),
+并且镜头的远裁剪面覆盖整个效果。
+
+## 软粒子
+
+带 `soft` 的层在与不透明几何体相接处淡出。它们需要 Forward+ 渲染器的深度纹理(已验证;Mobile 也有深度纹理,但未经验证);
+在 Compatibility 下它们几乎看不见。透明表面(水)除非写入深度,否则不在深度纹理中。
## Lab
`vfx showcase`(或 `godot --path vfx/godot`)打开 Lab:两个假人 PLAYER 和 TARGET 相对而立,每个效果按它的 `delivery` 演出 ——
`self` 在施法者身上,`melee` 在出招时打在目标身上,`projectile` 从施法者飞向目标并在到达时播放命中,`targeted` 降落在目标身上,
-`area` 以 Boss 重击为中心。按键:←/→ 切换,Space 重播,C 切换对战/单目标舞台,L 循环,P 暂停,1–4 速度,B 背景,S 自动展示。
+`area` 以 Boss 重击为中心,`beam` 从施法者的口部射向目标前方的地面,再扫到目标胸口(如果 `delivery.charge` 指定了蓄力,就在蓄力之后)。
+舞台随所选效果的 `scale.world` 缩放:怪兽效果在 70 m 高的假人之间演出,镜头按相同倍数拉远。按键:←/→ 切换,Space 重播,C 切换对战/单目标舞台,L 循环,P 暂停,1–4 速度,B 背景,S 自动展示。
`-- --no-glow` 关闭 HDR 泛光以便对比。
假人是胶囊体。可以用可选的绑骨替身角色替换它们:把 `player.glb` 和 `target.glb`(约 1 个单位高,Mixamo 风格的骨骼名称,
@@ -42,5 +78,5 @@ shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))
## 检查
-`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` 针对当前 manifest 测试播放、发射、暂停、速度、循环和自动回收。
+`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` 针对当前 manifest 测试播放、发射、光束(瞄准、功率、释放)、暂停、速度、循环和自动回收。
`godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd` 导出 Godot 运行时资源。只有实际运行过之后,才能报告它们通过。
diff --git a/docs/zh/references/primitives.md b/docs/zh/references/primitives.md
index ba436b7..93a01d8 100644
--- a/docs/zh/references/primitives.md
+++ b/docs/zh/references/primitives.md
@@ -13,7 +13,7 @@
## `effect()` 字段
-`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None)`
+`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None, hold=None, inputs=None, scale=None)`
| 字段 | 含义 |
|---|---|
@@ -22,8 +22,11 @@
| `duration`、`peak` | 秒;`peak` 是 Lab 闪光、镜头抖动和目标反应所用的接触/释放时刻 |
| `attach` | 锚点:`ground`、`body`、`impact`、`caster`、`caster_ground`、`projectile` |
| `impact`、`light` | Lab 舞台闪光和镜头抖动的强度(0–1)和 RGB(仅用于演示舞台) |
-| `delivery` | 游戏如何演出它:`SELF`、`MELEE`、`TARGETED`、`dict(kind='area')`;飞行体本身用 `dict(kind='projectile')`,它的命中用 `dict(kind='projectile', projectile='VFX_X')` |
+| `delivery` | 游戏如何演出它:`SELF`、`MELEE`、`TARGETED`、`dict(kind='area')`;飞行体本身用 `dict(kind='projectile')`,它的命中用 `dict(kind='projectile', projectile='VFX_X')`;持续光束用 `BEAM` 或 `dict(kind='beam', charge='VFX_X')`(Lab 会先播放蓄力) |
| `flight`、`arc` | 仅飞行体:参考飞行秒数和抛射高度(米) |
+| `hold` | 仅光束:Lab 在释放前持续发射它的秒数;`infinite` 的层一直发射到那时 |
+| `inputs` | `bind` 方程读取的游戏输入 `@In0..@In3` 的默认值;光束用 `beam_inputs(length)` |
+| `scale` | `'giant'`、`'kaiju'`、一个数字或 `{'world','time','budget'}`:为更大的世界构建角色尺度的配方([scale](scale.md)) |
| `design` | 一句话描述玩家看到什么;显示在 Lab 中,并提供给评审 |
## 基元
@@ -56,6 +59,8 @@
| `slice_line` | 释放时的长细线 | `T_Streak01` 从 35 % 射到全长,同时变细;`width` 是可见粗细 |
| `spray(end)` / `debris` | 沿射击方向的定向喷射、翻滚的暗色碎块 | 不旋转的发射 + 世界方向的 `travel` 盒;Blend `T_Shard01` 带重力,可以落地 |
| `decay(layer, color)` | 光 → 灰烟残影 | 复制为 Blend 灰色,晚 `lag` 帧,寿命 × `stretch`,无 emissive,流动更慢 |
+| `beam(name, core, body, rim, width=.5, ...)` | 由游戏瞄准和扫动的持续光束(吐息武器、激光、死光) | 轴向 billboard(`YAxisFixed`,枢轴在底部),通过 `bind` 拉伸到 `@In0` 并按 `@In1` 加宽;`T_BeamSection01` 截面、向外流动的噪声、口部与末端闪光、末端火花,可选的 `steam` 和 `scorch` 留在世界空间中([godot](godot.md#光束)) |
+| `charge_chain(name, anchors, color, hot, step=4, ...)` | 依次点亮一串点的电弧(背鳍骨板、线圈、地脉) | 每个锚点在 `delay + i*step` 处的节点光晕 + 弹出;手绘 `T_ArcStrand01` 电弧放在 `DirectionalBillboard` 上,由一个察觉不到的速度瞄准下一个锚点,每 `restrike` 帧镜像重新击出一次,直到 `until` |
## 辅助函数
@@ -65,6 +70,8 @@
| `fade(color, alpha=0)` | 相同的 RGB,新的 alpha |
| `POP`、`DISSOLVE` | 先弹出再缓慢漂移的缩放曲线;先保持(ease-in)再侵蚀的 cutoff 缓动 |
| `sustain(layer, interval)` | 飞行体发射器:每 `interval` 帧一个实例,直到释放 |
+| `held(layer, interval)` | 持续的交叉淡化:每 `interval` 帧一个实例,每个实例在 `interval` 内淡入并淡出,因此总有两个重叠且总和恒定(没有循环接缝的稳定光束) |
+| `beam_inputs(length, power=1)`、`BEAM_LENGTH`、`BEAM_POWER`、`BEAM` | 光束的默认输入、其 bind 方程使用的 `@In0`/`@In1` 名称,以及它的 delivery |
| `TRAIL` | 只在创建时继承位置/旋转/缩放:该层留在路径上 |
| `slash_set(colors, roll, sweep=(110,260), radius=1.5, offset=(0,0,.5), lean=-18, delay=1, life=14)` | 一把刀刃的三种宽度:晚两帧出现的宽而暗的残影、饱和的主体、细的白热边(`slash_arc`),一道折射弧,以及一个手绘赛璐璐月牙(`T_Slash02`,`billboard='Fixed'`,位于刀刃所在平面,按实测的 `SLASH02_BULGE` 旋转);`colors` = (残影, 主体, 热边) |
| `swing(layers, yaw, pitch=0)` | 把刀刃层包进一个 `renderer='None'` 枢轴,让弧在 3D 空间中劈过;约 ±30–40° 的 yaw 读起来是椭圆,而不是屏幕上的月牙 |
@@ -73,12 +80,20 @@
## 层字段
-除 PVA、缩放和颜色之外,编译器还支持:`collide`(地面弹跳)、`soft`(见引擎约定)、`size` / `size_end` / `size_curve`(统一缩放)、
+除 PVA、缩放和颜色之外,编译器还支持:`collide`(地面弹跳)、`soft`(粒子与不透明几何体相接处的淡出距离,世界单位;已在 Forward+ 中验证,见引擎约定)、
+`bind`(每帧根据游戏输入重新计算的位置/缩放,见下文)、`size` / `size_end` / `size_curve`(统一缩放)、
`color_end`、`color_curve`、`travel`(缓动位移)、`spawn`(球形、圆形、线形发射器)、`forces`(重力、湍流、涡旋)、
`alpha_texture` + `cutoff` + `edge`(带热边的溶解)、`distortion_texture`、`blend_texture`、`falloff`(fresnel)、`flipbook`、`pivot`、
`ring{...}`、`inherit`、`track_size`、`material`(`BackDistortion`)、`children`。`vfx layer-schema` 列出所有接受的键;
未知的键会报错并给出拼写建议。其他任何东西都必须连同 save/open 回读测试一起加进编译器,而不是在配方里写裸属性路径(流程见 [引擎约定](engine-conventions.md#扩展编译器))。
+### `bind`:由游戏驱动的值
+
+`bind={'position': [x, y, z], 'scale': [x, y, z]}` 把层的位置或缩放替换为一个 Fixed 向量,由 Effekseer 动态方程根据游戏输入
+`@In0..@In3`(Godot 中的 `handle.set_input()` / `Vfx.beam()`)**每帧**重新计算。每个分量可以是数字、方程字符串(`'@In0'`、`'@In0 * 0.5'`)
+或乘积 `[k, '@In1']`,其中常数 `k` 随配方的世界尺度缩放,而输入保持为世界值。配方必须用 `inputs=[...]` 为它读取的每个输入给出默认值。
+绑定的缩放不能与 `size`/`scale_*` 字段组合,绑定的位置不能与 `travel`/`velocity` 组合;子层跟随绑定的父层。
+
## 单位
层的 `life`、`delay`、`interval`:60 FPS 帧数。速度和加速度:单位/帧;重力:单位/帧²。角度:度。颜色:RGBA 0–255。
diff --git a/docs/zh/references/realism.md b/docs/zh/references/realism.md
new file mode 100644
index 0000000..9aca969
--- /dev/null
+++ b/docs/zh/references/realism.md
@@ -0,0 +1,54 @@
+# 照片级的爆炸、火焰和烟
+
+当简报要求写实外观(电影、实拍参考、照片级写实的游戏)而不是默认的风格化外观时使用本文。制作规则依然适用 —— 时间结构、
+明度分层、形状变化 —— 但颜色、亮度和纹理来自照片。
+
+## 来自照片的颜色和亮度
+
+燃料和弹药爆炸的日光照片与高速影片在下面这些数值上一致(sRGB,未经 Lab 泛光)。它们就是 `VFX_Kaiju_Explosion` 的调色板:
+
+| 职责 | RGB | 说明 |
+|---|---|---|
+| 接触核心 | 255, 244, 214 | 淡黄白,**不是**纯白;一次短促的尖峰,约 8 个 Lab 帧内消失 |
+| 火焰主体 | 255, 168, 72 | 橙色;接触之后,主体是最亮的部分 |
+| 冷却边缘 | 214, 84, 28 | 火焰与烟灰相接处的深红橙 |
+| 最后的余光 | 120, 40, 18 → 60, 20, 10 | 烟里暗红的余火团,然后熄灭 |
+| 烟灰 | 38, 32, 29 | 偏暖的近黑色,不透明:火在它前面燃烧 |
+| 烟柱 | 92, 84, 78 | 棕灰色;顶部受阳光照射处较亮,底部较暗 |
+| 尘埃裙边 | 150, 136, 118 | 地面的颜色,比烟浅 |
+| 蒸汽 | 205, 215, 225 | 近白色,稀薄,上升很快并消失 |
+
+- **火焰中避免粉色和品红。** 饱和的红粉色(R 和 B 都高)一眼就会被看成游戏特效。
+- **火焰不会长时间保持白色。** 照片中白热的画面只有一两帧;之后最亮的像素是黄橙色。在 Lab 的泛光下,在一段长寿命中
+ 10 % 都停留在近白的 ramp,读起来是一次过曝的闪光(一次独立评审恰好指出了这一点);在约 5 % 处就转为橙色。
+- **烟比火存活得久得多**,而且移动缓慢:真实的爆炸中,火球大约一秒就消失,烟柱则持续攀升许多秒。保持它的浓度
+ (colour_end 的 alpha 大于零),在它仍然明显变稀薄时结束效果,而不是等它完全消失之后。
+- **烟从上方受光。** 照片级的烟雾序列图顶部亮、底部暗;把滚转保持在小范围(±12°),让光一直在顶部,并用
+ `spawn rotate=False` 发射,使 `velocity` 朝世界上方。
+- Emissive:加色火焰 1.3–1.8 就够了;更亮的值会把主体推过泛光阈值,变成白色。卖点是明度结构(淡色核心、橙色主体、
+ 暗色烟灰),而不是原始强度。
+
+## 纹理
+
+手绘的风格化烟团放在照片级写实的世界里看起来像卡通。本技能随附三张照片级序列帧(4×4,1024²,由图像模型生成并处理;
+提示词在 `assets/examples/texture_prompts.json` 中):
+
+| 纹理 | 用途 | 混合 |
+|---|---|---|
+| `T_FireballSheet01` | 火球:alpha = 亮度,所以炽热的团块发光,烟灰透明 | Add,配 `ramp` |
+| `T_FireballSootSheet01` | 同一个火球的不透明主体(着色的灰色,完整剪影) | Blend,排在火焰**之前** |
+| `T_SmokeSheet02` | 照片级的翻滚烟柱,顶部受光 | Blend,用烟的颜色着色 |
+
+`smoke()` 会把任何 `T_*Sheet*` 纹理当作 4×4 序列帧播放。对于必须一直浓到最后的烟柱,放慢序列帧
+(`flipbook=dict(x=4, y=4, frame_length=8, loop='Once')`),让它在图集最后几格几乎空白的帧之前停下。
+
+## 烟和火与地面相接
+
+穿过地面或水面的 sprite 会留下一条硬的水平线。给地面的烟、尘和蒸汽一个 `soft` 距离(世界单位,烟团尺寸的三分之一到二分之一)
+—— 已在 Forward+ 中验证,见 [引擎约定](engine-conventions.md#渲染hdr-与-lab)。
+
+## 照片级爆炸的层计划
+
+从后到前:热浪扭曲 → 烟柱(soft,慢速序列帧)→ 烟灰主体(Blend)→ 火球(Add,照片级 ramp)→ 从火球甩出的火舌 →
+接触闪光和短暂的光晕 → 带 soft 尘埃裙边向外滚动的地面枢轴 → 地面冲击环和折射 → 分档的火花 → 会落地的暗色碎块。
+`vfx examples show VFX_Kaiju_Explosion` 会打印时间线。
diff --git a/docs/zh/references/scale.md b/docs/zh/references/scale.md
new file mode 100644
index 0000000..b3a3ba2
--- /dev/null
+++ b/docs/zh/references/scale.md
@@ -0,0 +1,87 @@
+# 世界尺度:巨人、怪兽、战舰
+
+目录:为什么尺度不只是尺寸 · 声明尺度 · 哪些字段会换算 · 编写放大的配方 · 放大后的 Lab · 随配方缩放的检查 ·
+在游戏中使用放大的效果 · 如何验证
+
+## 为什么尺度不只是尺寸
+
+本技能中的每个基元、默认值和制作数值,都是针对 1 单位 = 1 m 世界中约 1.75 m 的角色调出来的:火花以 0.0015 单位/帧²
+下落,接触持续 2–5 帧,Lab 锚点位于 0.95 m 和 1.35 m。一只 70 m 高的怪兽需要同样的效果放大 40 倍 —— 而且要**更慢**。
+放大后却保留角色尺度时间的爆炸,看起来像桌上的微缩模型:碎块一秒钟落下 40 m,烟像杯子里的热气一样翻滚。电影模型师
+用高帧率拍摄微缩模型也是同一个原因(弗劳德相似律:时间随尺寸的平方根增长)。
+
+游戏和电影不会做到底:按 sqrt(40) ≈ 6.3x,一次怪兽爆炸会持续十秒,吐息武器也会显得迟钝。下面的档位把时间拉长约
+world^0.25 倍,所以 40x 的效果持续 2.5x 的时间。
+
+## 声明尺度
+
+按 Lab 的角色尺度编写配方,然后给 `effect()` 加上 `scale`:
+
+```python
+return effect('Kaiju_Explosion', 'Kaiju Explosion', 'explosion', 'fire', 2.3, [...], scale='kaiju')
+```
+
+| `scale` | world | time | budget | 适用于 |
+|---|---|---|---|---|
+| `'character'`(默认) | 1 | 1 | 1 | 人类、约 3 m 以内的生物 |
+| `'giant'` | 8 | 1.7 | 2 | 10–20 m 的巨人、攻城器械、机甲 |
+| `'kaiju'` | 40 | 2.5 | 3 | 50–100 m 的怪兽、战舰、城市级的打击 |
+| 一个数字,例如 `16` | 16 | 16^0.25 = 2.0 | 16^0.3 | 你自己的尺寸;time 和 budget 按曲线计算 |
+| `{'world': 40, 'time': 1.5, 'budget': 2}` | 按给定值 | 按给定值 | 按给定值 | 精确的档位(想要更快的怪兽的游戏) |
+
+`effect()` 会立即换算配方,并把档位记录在 `recipe['scale']` 下;manifest 会带上它,所以 Lab 和 `Vfx.gd` 知道效果的尺寸。
+简报的 `beats` 以及你在复查中读到的每个帧号,都是**构建后**(换算后)时间线上的帧:在第 4 帧编写的接触,在怪兽连拍中位于第 10 帧。
+
+## 哪些字段会换算
+
+| 分组 | 字段 | 换算 |
+|---|---|---|
+| 时间 | `life`、`delay`、`interval`、`fade_in`、`fade_out`、`flipbook.frame_length`;效果的 `duration`、`peak`、`flight`、`hold` | × time(`life` 和帧长度向下取整为整数帧,所以没有东西会活过拉长后的 duration) |
+| 速率 | `uv_scroll`、`alpha_scroll`、`distortion_scroll`、`blend_scroll`、`spin` | ÷ time |
+| 节点缩放 | `size`、`size_end`、`scale_start`、`scale_end`(都没有的层会得到 `scale_start=[world]*3`) | × world |
+| 位置 | `position`、`travel.start/end`、`spawn.radius/start/end/noise`、力的 `position` | × world |
+| 运动 | `velocity`、湍流/涡旋的 `power` | × world ÷ time |
+| 加速度 | `acceleration`、重力 | × world ÷ time² |
+| 世界坐标 | `collide.height`、`soft` | × world,在每一层级上 |
+| `bind` | 数字以及 `[k, '@In1']` 中的常数 | × world;方程字符串(`'@In0'`)是游戏提供的世界值,保持不变 |
+| 效果 | `arc` | × world |
+
+只有**顶层的层**会在空间上缩放:子层位于父层的坐标系中,而父层已经缩放过,所以子层只改变时间字段和世界坐标字段。
+带 `inherit={'scale': 'NotBind'}` 的子层重新处于世界单位中,会像顶层的层一样缩放。Ring 和程序化网格的几何位于节点缩放之内,
+不需要任何处理。
+
+## 编写放大的配方
+
+- 按角色尺度思考和调整:你从其他示例中熟悉的锚点、尺寸和速度依然适用。看的是换算后效果的连拍,而不是 1x 版本的连拍。
+- 怪兽效果主要是**质量感**:更多的烟和尘的体积、更慢的次级运动、更长的消散、更少但更大的碎块。预算倍数用于密度,
+ 而不是用来加更多杂乱的细节。
+- 任何必须贴着表面的东西(尘埃裙边、地面火)都需要世界高度:照常相对 Lab 锚点来写(`impact` 锚点下的 `floor = -1.3`),
+ 换算会缩放它们。
+- 手绘纹理保持原分辨率:一张覆盖 100 m 屏幕范围的 1024² 序列帧会发虚。优先使用大形体的照片级序列图(见
+ [realism](realism.md)),并叠两三个烟团,而不是用一张巨大的卡片。
+
+## 放大后的 Lab
+
+Lab 读取所选效果的 `scale.world`,并以世界原点为中心缩放整个舞台:平台、地面、假人(怪兽尺度下是 70 m 的胶囊体)、
+镜头位置、近/远裁剪面、阴影距离、舞台闪光(光能量随距离增长,Godot 的 omni 光按 1/距离衰减)以及镜头抖动。
+构图与角色尺度的连拍完全相同,所以复查指标(以舞台高度计量)和评审的眼睛可以跨尺度比较。副标题显示 `KAIJU x40`。
+
+## 随配方缩放的检查
+
+| 检查 | 缩放方式 |
+|---|---|
+| lint 粒子预算 | × budget |
+| lint 重力上限(1x 时为 0.01 单位/帧²) | × world ÷ time² |
+| lint 接触闪光长度、接触层寿命、峰值容差 | × time |
+| review 闪光跨度、偏离峰值容差、空尾段最小值 | × time |
+
+## 在游戏中使用放大的效果
+
+`.efk` 是以世界单位构建的:以缩放 1 播放它(`Vfx.play(id, position)`);不要再次缩放发射器。manifest 的 `scale` 条目
+对游戏(和 Lab)只是说明信息。光束的 `@In0` 长度是世界距离,所以 `Vfx.beam()` 在任何尺度下用法都相同。
+
+## 如何验证
+
+用 `scale={'world': 40, 'time': 1}` 构建了一份 `VFX_Fire_Explosion` 的副本,在放大的 Lab 中与原版并排渲染:画面逐像素平均差在
+4–6/255 以内(随机火花和泛光有差异),所以空间换算在 40x 下精确地再现了效果。时间拉伸是一个设计选择,通过对怪兽示例
+(`vfx examples add kaiju`)的独立评审来判断。
diff --git a/skills/effekseer-vfx/SKILL.md b/skills/effekseer-vfx/SKILL.md
index 54aab3c..53ad7ea 100644
--- a/skills/effekseer-vfx/SKILL.md
+++ b/skills/effekseer-vfx/SKILL.md
@@ -1,10 +1,10 @@
---
name: effekseer-vfx
-description: Author real-time game VFX as code for the Effekseer engine and verify them in a real Godot render. Use when asked to create, edit, review or iterate on Effekseer effects (.efkefc/.efk), game hit, slash, projectile, explosion, magic, buff or shield VFX, or a VFX library for a Godot game. Covers design briefs, texture generation prompts, Python recipe code, EffekseerCore compilation, filmstrip review, independent scoring and export.
+description: Author real-time game VFX as code for the Effekseer engine and verify them in a real Godot render. Use when asked to create, edit, review or iterate on Effekseer effects (.efkefc/.efk), game hit, slash, projectile, explosion, beam, charge, magic, buff or shield VFX, realistic or kaiju/giant-scale effects, or a VFX library for a Godot game. Covers design briefs, texture generation prompts, Python recipe code, EffekseerCore compilation, filmstrip review, independent scoring and export.
license: MIT
compatibility: Build and render need macOS on Apple silicon or Windows (x64), Godot 4.x and network access for the first setup (Effekseer Core, .NET runtime, Effekseer Godot plugin). Authoring, lint and texture processing run on macOS, Linux or Windows with Python 3.11+.
metadata:
- version: "0.1.1"
+ version: "0.2.0"
---
# Effekseer VFX
@@ -27,7 +27,7 @@ On Windows, `sh <skill>/scripts/vfx` works from Git Bash; from cmd or PowerShell
`doctor`'s `next` prints the exact command for this machine.
Setup needs Python 3.11+ or uv (macOS's built-in Python 3.9 is too old); if `doctor` reports neither, ask the user to install one. Godot 4 (Forward+) must be installed by the user; set `GODOT` if it is not on `PATH`.
3. `vfx init` creates `vfx/` (Godot Lab, materials, math textures, official Effekseer plugin). It never overwrites existing files unless `--update-templates`.
-4. Optional: `vfx examples add <name>` copies a finished, independently reviewed example to learn from: pairs `fire`, `ice`, `poison`, `dark` (projectile + impact) and singles `hit`, `slash`, `charge`, `shield`, `heal`, or `all`. See [references/examples.md](references/examples.md).
+4. Optional: `vfx examples add <name>` copies a finished, independently reviewed example to learn from: pairs `fire`, `ice`, `poison`, `dark` (projectile + impact), singles `hit`, `slash`, `charge`, `shield`, `heal`, the set `kaiju` (world scale, beam, charge chain, photographic explosion), or `all`. See [references/examples.md](references/examples.md).
`vfx review`, `preview` and `showcase` open a Godot window on the user's desktop. If you run inside a sandbox (Codex's
workspace sandbox, for example), run those commands outside it with the user's approval, or give the user the exact
@@ -39,7 +39,7 @@ look. Say so plainly: report the work as **not compiled and not render-verified*
## Making or changing one effect
-1. **Read before writing.** Always read [craft](references/craft.md), [design](references/design.md), [layering](references/layering.md), [timing](references/timing.md) and [skeletons](references/skeletons.md); then the topic files from the routing table below, and `vfx examples show <name>` for the matching example's layer plan (names: `hit`, `slash`, `charge`, `shield`, `heal`, or the pairs `fire`, `ice`, `poison`, `dark` for projectiles and impacts such as explosions; an effect ID also works). For an existing effect run `vfx effect-context <ID>` and read its history so you do not repeat a failed change.
+1. **Read before writing.** Always read [craft](references/craft.md), [design](references/design.md), [layering](references/layering.md), [timing](references/timing.md) and [skeletons](references/skeletons.md); then the topic files from the routing table below, and `vfx examples show <name>` for the matching example's layer plan (names: `hit`, `slash`, `charge`, `shield`, `heal`, the pairs `fire`, `ice`, `poison`, `dark` for projectiles and impacts such as explosions, or `kaiju` for large-scale, beam and realistic effects; an effect ID also works). For an existing effect run `vfx effect-context <ID>` and read its history so you do not repeat a failed change.
2. **Brief.** Write `vfx/briefs/<ID>.json` (three key frames, palette roles, beats, layer plan, acceptance, avoid). Format in [design.md](references/design.md).
3. **Textures.** Math shapes (glows, rings, noise, trails, distortion maps) and a starter set of painted smoke, explosion, wisp, crack and ice textures already exist after `init`. Complex painted shapes (flame, slash, smoke, crack, ice, rune) come from an image generation model — follow [textures.md](references/textures.md). Measure every texture with `vfx texture-info` before using its angle.
4. **Recipe.** Write `vfx/src/<ID>.py` defining `recipe()` with the primitives in [primitives.md](references/primitives.md). Follow the verified engine rules in [engine-conventions.md](references/engine-conventions.md) instead of guessing axes, units or blend behaviour.
@@ -58,6 +58,7 @@ look. Say so plainly: report the work as **not compiled and not render-verified*
- Do not draw complex painted shapes with Python. If no image generation tool is available, write the prompt into `vfx/texture_prompts.json` and ask the user for the image.
- Keep generated originals in `vfx/textures/generated/` and write processed copies to `vfx/textures/processed/`; record every prompt.
- Units: recipe timing in 60 FPS frames, F-curves in percent of life, manifest duration/peak in seconds, Godot API rotation in radians.
+- Write recipes at the Lab's character scale; for a larger world declare `scale` instead of hand-scaling numbers ([scale](references/scale.md)). Frames in briefs and reviews are the built, scaled timeline.
- Every effect declares `delivery`; a projectile needs a paired impact effect that points back to it.
- Use only layer fields the compiler knows (`vfx layer-schema`); extend the compiler instead of writing raw property paths into recipes.
- A full `vfx build` (no `--ids`) prunes the outputs of effects this skill built whose source left `vfx/src/`; it never deletes effects it did not build and refuses to run on an empty library. Use `--ids` for partial work (a broken source elsewhere is reported in `unloaded` instead of blocking it).
@@ -71,6 +72,9 @@ look. Say so plainly: report the work as **not compiled and not render-verified*
| slash, projectile, charge, aura, anything that travels | [motion.md](references/motion.md) |
| shield, pillar, boss, status, volumes, occlusion | [shapes.md](references/shapes.md) |
| matching a reference video | [reference.md](references/reference.md) |
+| giants, kaiju, warships: anything far larger than a character | [scale.md](references/scale.md) |
+| beam, laser, breath weapon, charge chain, values the game drives at runtime | [primitives.md](references/primitives.md) (`beam`, `charge_chain`, `bind`), [godot.md](references/godot.md#beams) |
+| realistic / photographic explosion, fire, smoke, steam | [realism.md](references/realism.md) |
| a specific visual failure (white blob, empty tail, no break-up) | [cases.md](references/cases.md) |
| adding an engine feature to the compiler | [engine-conventions.md](references/engine-conventions.md#extending-the-compiler), `vfx discover`, `vfx core property-list/get/set` |
| using the effects in a game | [godot.md](references/godot.md) |
diff --git a/skills/effekseer-vfx/assets/brief.schema.json b/skills/effekseer-vfx/assets/brief.schema.json
index c2039dc..e302963 100644
--- a/skills/effekseer-vfx/assets/brief.schema.json
+++ b/skills/effekseer-vfx/assets/brief.schema.json
@@ -14,7 +14,7 @@
"type": "object", "required": ["core", "body", "dark", "matter"],
"additionalProperties": {"type": "array", "minItems": 3, "maxItems": 4, "items": {"type": "integer", "minimum": 0, "maximum": 255}}
},
- "delivery": {"type": "object", "required": ["kind"], "properties": {"kind": {"enum": ["self", "melee", "projectile", "targeted", "area"]}, "projectile": {"type": "string"}}, "additionalProperties": false},
+ "delivery": {"type": "object", "required": ["kind"], "properties": {"kind": {"enum": ["self", "melee", "projectile", "targeted", "area", "beam"]}, "projectile": {"type": "string"}, "charge": {"type": "string"}}, "additionalProperties": false},
"anchor": {"type": "string"},
"reference": {"type": ["object", "null"], "properties": {"id": {"type": "string"}}, "required": ["id"]},
"beats": {"type": "array", "minItems": 1, "items": {"type": "object", "required": ["frame", "name", "expect"], "additionalProperties": false, "properties": {"frame": {"type": "integer", "minimum": 0}, "name": {"type": "string", "minLength": 1}, "expect": {"type": "string", "minLength": 1}}}},
diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Atomic_Beam.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Atomic_Beam.json
new file mode 100644
index 0000000..5680fd3
--- /dev/null
+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Atomic_Beam.json
@@ -0,0 +1,168 @@
+{
+ "schema_version": 1,
+ "effect_id": "VFX_Kaiju_Atomic_Beam",
+ "role": "sustained breath weapon",
+ "style": "realistic kaiju film, electric blue",
+ "dominant_shape": "A white-hot line inside a saturated blue beam with a wide dim rim; noise streams outward along it, steam, sparks, cooling scorch and smouldering smoke stay where it lands, and it stays locked to its end point while the game rakes it.",
+ "palette": {
+ "core": [
+ 230,
+ 246,
+ 255
+ ],
+ "body": [
+ 60,
+ 150,
+ 255
+ ],
+ "dark": [
+ 25,
+ 60,
+ 220
+ ],
+ "matter": [
+ 205,
+ 215,
+ 225
+ ]
+ },
+ "delivery": {
+ "kind": "beam",
+ "charge": "VFX_Kaiju_Atomic_Charge"
+ },
+ "anchor": "caster",
+ "beats": [
+ {
+ "frame": 4,
+ "name": "ignition",
+ "expect": "A white flash at the mouth as a thin beam shoots to its end point"
+ },
+ {
+ "frame": 30,
+ "name": "full power",
+ "expect": "White core inside a saturated blue body with a dim rim; sparks at the end"
+ },
+ {
+ "frame": 160,
+ "name": "rake",
+ "expect": "The end point has climbed toward the target; the beam stays attached to it"
+ },
+ {
+ "frame": 225,
+ "name": "release",
+ "expect": "The beam narrows and fades within a quarter second; steam is left at the end"
+ },
+ {
+ "frame": 300,
+ "name": "steam",
+ "expect": "Rising steam and cooling scorch marks along the raked path"
+ },
+ {
+ "frame": 360,
+ "name": "exit",
+ "expect": "Smouldering smoke along the raked path is still thinning out"
+ }
+ ],
+ "layer_plan": [
+ {
+ "name": "0:Breath haze",
+ "role": "heat",
+ "primitive": "beam strip BackDistortion T_DistortHaze01",
+ "exit": "fades within two intervals of release, by absolute frame 255"
+ },
+ {
+ "name": "1:Breath rim",
+ "role": "rim",
+ "primitive": "beam strip T_BeamSection01, noise alpha streaming outward",
+ "exit": "fades by absolute frame 255"
+ },
+ {
+ "name": "2:Breath body",
+ "role": "body",
+ "primitive": "beam strip T_BeamSection01, saturated blue, blend-texture streaks",
+ "exit": "fades by absolute frame 255"
+ },
+ {
+ "name": "3:Breath core",
+ "role": "core",
+ "primitive": "beam strip T_BeamSection01, thin white-hot line",
+ "exit": "fades by absolute frame 255"
+ },
+ {
+ "name": "4:Breath origin glow",
+ "role": "source",
+ "primitive": "held point sprite at the mouth, scaled by power",
+ "exit": "fades by absolute frame 255"
+ },
+ {
+ "name": "5:Breath origin flare",
+ "role": "source",
+ "primitive": "held point sprite at the mouth, scaled by power",
+ "exit": "fades by absolute frame 255"
+ },
+ {
+ "name": "6:Breath end glow",
+ "role": "hit",
+ "primitive": "held point sprite bound to the end point (@In0)",
+ "exit": "fades by absolute frame 255"
+ },
+ {
+ "name": "7:Breath end flare",
+ "role": "hit",
+ "primitive": "held point sprite bound to the end point (@In0)",
+ "exit": "fades by absolute frame 255"
+ },
+ {
+ "name": "8:Breath hit point",
+ "role": "emitter",
+ "primitive": "None pivot riding the end point",
+ "exit": "last instance by absolute frame 255"
+ },
+ {
+ "name": "8:Breath hit point/0:Breath end sparks",
+ "role": "secondary",
+ "primitive": "radial_sparks left behind in world space",
+ "exit": "cool and fade by absolute frame 265"
+ },
+ {
+ "name": "8:Breath hit point/1:Breath end steam",
+ "role": "residue",
+ "primitive": "soft smoke (T_SmokeSheet01) rising from the hit point",
+ "exit": "dissipates by absolute frame 350"
+ },
+ {
+ "name": "8:Breath hit point/2:Breath scorch",
+ "role": "residue",
+ "primitive": "Sprite T_Glow01 scorch left in world space, cooling blue-white to dark",
+ "exit": "cools out by absolute frame 350"
+ },
+ {
+ "name": "8:Breath hit point/3:Breath smoulder",
+ "role": "residue",
+ "primitive": "soft photographic smoke (T_SmokeSheet02) left along the raked path, slow flipbook",
+ "exit": "thins out by absolute frame 375"
+ },
+ {
+ "name": "9:Ignition flash",
+ "role": "contact",
+ "primitive": "Sprite T_Flare01 at the mouth",
+ "exit": "gone by absolute frame 14"
+ },
+ {
+ "name": "10:Ignition shell",
+ "role": "contact",
+ "primitive": "Model shell punched out by the beam",
+ "exit": "fades by absolute frame 38"
+ }
+ ],
+ "acceptance": [
+ "The beam keeps a white core and a blue body; it never turns into a white bar",
+ "The end flash, sparks and steam stay on the moving end point",
+ "Ignition and release read in a few frames, not as a slow fade"
+ ],
+ "avoid": [
+ "A beam that pinches at either end",
+ "Sparks that stay glued to the end point after it moves on",
+ "Blue lost under the bloom"
+ ]
+}
diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Atomic_Charge.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Atomic_Charge.json
new file mode 100644
index 0000000..e41f01c
--- /dev/null
+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Atomic_Charge.json
@@ -0,0 +1,354 @@
+{
+ "schema_version": 1,
+ "effect_id": "VFX_Kaiju_Atomic_Charge",
+ "role": "self charge before a beam",
+ "style": "realistic kaiju film, electric blue",
+ "dominant_shape": "Crystal plates on the back switch on one by one from the hips to the head, each with a spark and an arc jumping to the next, and stay lit, until the mouth gathers a blue glow and one flash hands over to the beam.",
+ "palette": {
+ "core": [
+ 225,
+ 245,
+ 255
+ ],
+ "body": [
+ 70,
+ 150,
+ 255
+ ],
+ "dark": [
+ 30,
+ 70,
+ 220
+ ],
+ "matter": [
+ 20,
+ 40,
+ 120
+ ]
+ },
+ "delivery": {
+ "kind": "self"
+ },
+ "anchor": "caster",
+ "beats": [
+ {
+ "frame": 4,
+ "name": "hips",
+ "expect": "The lowest plate on the back lights and a jagged arc already jumps to the next plate"
+ },
+ {
+ "frame": 60,
+ "name": "climb",
+ "expect": "Three plates are lit and the arc is still climbing; lit plates keep re-striking"
+ },
+ {
+ "frame": 125,
+ "name": "head",
+ "expect": "The last plate behind the head lights; streaks converge on a glowing mouth"
+ },
+ {
+ "frame": 161,
+ "name": "release",
+ "expect": "One flash at the mouth: the only white flash of the effect"
+ },
+ {
+ "frame": 185,
+ "name": "release sparks",
+ "expect": "Sparks thrown forward from the mouth cool to blue; the plates fade"
+ }
+ ],
+ "layer_plan": [
+ {
+ "name": "0:Back glow",
+ "role": "volume",
+ "primitive": "Sprite T_Glow01 glow behind the spine",
+ "exit": "fades by absolute frame 175"
+ },
+ {
+ "name": "1:Plate 1 fin",
+ "role": "shape",
+ "primitive": "crystal fin (six-sided cylinder mesh with fresnel edge), dim from frame 0, pops white at its turn, then blue",
+ "exit": "fades by absolute frame 180"
+ },
+ {
+ "name": "2:Plate 2 fin",
+ "role": "shape",
+ "primitive": "crystal fin (six-sided cylinder mesh with fresnel edge), dim from frame 0, pops white at its turn, then blue",
+ "exit": "fades by absolute frame 180"
+ },
+ {
+ "name": "3:Plate 3 fin",
+ "role": "shape",
+ "primitive": "crystal fin (six-sided cylinder mesh with fresnel edge), dim from frame 0, pops white at its turn, then blue",
+ "exit": "fades by absolute frame 180"
+ },
+ {
+ "name": "4:Plate 4 fin",
+ "role": "shape",
+ "primitive": "crystal fin (six-sided cylinder mesh with fresnel edge), dim from frame 0, pops white at its turn, then blue",
+ "exit": "fades by absolute frame 180"
+ },
+ {
+ "name": "5:Plate 5 fin",
+ "role": "shape",
+ "primitive": "crystal fin (six-sided cylinder mesh with fresnel edge), dim from frame 0, pops white at its turn, then blue",
+ "exit": "fades by absolute frame 180"
+ },
+ {
+ "name": "6:Plate 6 fin",
+ "role": "shape",
+ "primitive": "crystal fin (six-sided cylinder mesh with fresnel edge), dim from frame 0, pops white at its turn, then blue",
+ "exit": "fades by absolute frame 180"
+ },
+ {
+ "name": "7:Plates node 1",
+ "role": "body",
+ "primitive": "Sprite T_Glow01 plate glow, stays lit",
+ "exit": "fades by absolute frame 160"
+ },
+ {
+ "name": "8:Plates node 1 spark",
+ "role": "ignition",
+ "primitive": "Sprite T_Glow01 pop on the plate as it lights",
+ "exit": "gone by absolute frame 12"
+ },
+ {
+ "name": "9:Plates arc 1a",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 160"
+ },
+ {
+ "name": "10:Plates arc 1b",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 152"
+ },
+ {
+ "name": "11:Plates node 2",
+ "role": "body",
+ "primitive": "Sprite T_Glow01 plate glow, stays lit",
+ "exit": "fades by absolute frame 160"
+ },
+ {
+ "name": "12:Plates node 2 spark",
+ "role": "ignition",
+ "primitive": "Sprite T_Glow01 pop on the plate as it lights",
+ "exit": "gone by absolute frame 32"
+ },
+ {
+ "name": "13:Plates arc 2a",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 150"
+ },
+ {
+ "name": "14:Plates arc 2b",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 158"
+ },
+ {
+ "name": "15:Plates node 3",
+ "role": "body",
+ "primitive": "Sprite T_Glow01 plate glow, stays lit",
+ "exit": "fades by absolute frame 160"
+ },
+ {
+ "name": "16:Plates node 3 spark",
+ "role": "ignition",
+ "primitive": "Sprite T_Glow01 pop on the plate as it lights",
+ "exit": "gone by absolute frame 52"
+ },
+ {
+ "name": "17:Plates arc 3a",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 155"
+ },
+ {
+ "name": "18:Plates arc 3b",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 162"
+ },
+ {
+ "name": "19:Plates node 4",
+ "role": "body",
+ "primitive": "Sprite T_Glow01 plate glow, stays lit",
+ "exit": "fades by absolute frame 160"
+ },
+ {
+ "name": "20:Plates node 4 spark",
+ "role": "ignition",
+ "primitive": "Sprite T_Glow01 pop on the plate as it lights",
+ "exit": "gone by absolute frame 72"
+ },
+ {
+ "name": "21:Plates arc 4a",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 160"
+ },
+ {
+ "name": "22:Plates arc 4b",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 152"
+ },
+ {
+ "name": "23:Plates node 5",
+ "role": "body",
+ "primitive": "Sprite T_Glow01 plate glow, stays lit",
+ "exit": "fades by absolute frame 160"
+ },
+ {
+ "name": "24:Plates node 5 spark",
+ "role": "ignition",
+ "primitive": "Sprite T_Glow01 pop on the plate as it lights",
+ "exit": "gone by absolute frame 92"
+ },
+ {
+ "name": "25:Plates arc 5a",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 150"
+ },
+ {
+ "name": "26:Plates arc 5b",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 158"
+ },
+ {
+ "name": "27:Plates node 6",
+ "role": "body",
+ "primitive": "Sprite T_Glow01 plate glow, stays lit",
+ "exit": "fades by absolute frame 160"
+ },
+ {
+ "name": "28:Plates node 6 spark",
+ "role": "ignition",
+ "primitive": "Sprite T_Glow01 pop on the plate as it lights",
+ "exit": "gone by absolute frame 112"
+ },
+ {
+ "name": "29:Plates arc 6a",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 155"
+ },
+ {
+ "name": "30:Plates arc 6b",
+ "role": "shape",
+ "primitive": "charge_chain arc: T_ArcStrand01 on a DirectionalBillboard aimed at the next plate, re-struck mirrored",
+ "exit": "last strike ends by absolute frame 162"
+ },
+ {
+ "name": "31:Plates node 7",
+ "role": "body",
+ "primitive": "Sprite T_Glow01 plate glow, stays lit",
+ "exit": "fades by absolute frame 160"
+ },
+ {
+ "name": "32:Plates node 7 spark",
+ "role": "ignition",
+ "primitive": "Sprite T_Glow01 pop on the plate as it lights",
+ "exit": "gone by absolute frame 132"
+ },
+ {
+ "name": "33:Plate 1 sparks",
+ "role": "secondary",
+ "primitive": "radial_sparks as each plate ignites",
+ "exit": "gone by absolute frame 30"
+ },
+ {
+ "name": "34:Plate 2 sparks",
+ "role": "secondary",
+ "primitive": "radial_sparks as each plate ignites",
+ "exit": "gone by absolute frame 50"
+ },
+ {
+ "name": "35:Plate 3 sparks",
+ "role": "secondary",
+ "primitive": "radial_sparks as each plate ignites",
+ "exit": "gone by absolute frame 70"
+ },
+ {
+ "name": "36:Plate 4 sparks",
+ "role": "secondary",
+ "primitive": "radial_sparks as each plate ignites",
+ "exit": "gone by absolute frame 90"
+ },
+ {
+ "name": "37:Plate 5 sparks",
+ "role": "secondary",
+ "primitive": "radial_sparks as each plate ignites",
+ "exit": "gone by absolute frame 110"
+ },
+ {
+ "name": "38:Plate 6 sparks",
+ "role": "secondary",
+ "primitive": "radial_sparks as each plate ignites",
+ "exit": "gone by absolute frame 130"
+ },
+ {
+ "name": "39:Mouth body",
+ "role": "hand-over",
+ "primitive": "Sprite T_Glow01 blue glow growing at the mouth",
+ "exit": "gone by absolute frame 170"
+ },
+ {
+ "name": "40:Mouth core",
+ "role": "hand-over",
+ "primitive": "Sprite T_Glow01 small white core inside it",
+ "exit": "gone by absolute frame 170"
+ },
+ {
+ "name": "41:Mouth pivot",
+ "role": "placement",
+ "primitive": "None pivot at the mouth",
+ "exit": "ends by absolute frame 165"
+ },
+ {
+ "name": "41:Mouth pivot/0:Mouth gather",
+ "role": "inward motion",
+ "primitive": "radial_sparks spawned on a shell round the mouth, EaseInCubic travel inward",
+ "exit": "last streak ends by absolute frame 193"
+ },
+ {
+ "name": "42:Ion motes",
+ "role": "secondary",
+ "primitive": "Sprite T_Glow01 motes drifting round the back",
+ "exit": "last mote ends by absolute frame 175"
+ },
+ {
+ "name": "43:Charged flash",
+ "role": "release",
+ "primitive": "Sprite T_Flare01 flash at the mouth",
+ "exit": "gone by absolute frame 172"
+ },
+ {
+ "name": "44:Release sparks",
+ "role": "release",
+ "primitive": "radial_sparks thrown forward from the mouth",
+ "exit": "cool and fade by absolute frame 200"
+ },
+ {
+ "name": "45:Plate afterglow",
+ "role": "tail",
+ "primitive": "Sprite T_Glow01 fading on the back",
+ "exit": "gone by absolute frame 200"
+ }
+ ],
+ "acceptance": [
+ "The plates light one after another from the tail to the head, never all at once",
+ "Each arc connects two neighbouring plates and changes shape while it burns",
+ "The chain reads at kaiju scale: the dummies are 70 m tall and the arcs span the whole back"
+ ],
+ "avoid": [
+ "A uniform glow over the whole back",
+ "Arcs that point away from the next plate",
+ "A flash before the chain reaches the head"
+ ]
+}
diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Explosion.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Explosion.json
new file mode 100644
index 0000000..bfae1e4
--- /dev/null
+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Kaiju_Explosion.json
@@ -0,0 +1,162 @@
+{
+ "schema_version": 1,
+ "effect_id": "VFX_Kaiju_Explosion",
+ "role": "large impact explosion",
+ "style": "photographic, daylight fuel explosion",
+ "dominant_shape": "A pale yellow-white flash becomes an orange fireball rolling up out of its own soot, lobes break off it, a dust skirt rolls along the ground and a brown-grey smoke column keeps climbing after the fire is gone.",
+ "palette": {
+ "core": [
+ 255,
+ 244,
+ 214
+ ],
+ "body": [
+ 255,
+ 168,
+ 72
+ ],
+ "dark": [
+ 38,
+ 32,
+ 29
+ ],
+ "matter": [
+ 92,
+ 84,
+ 78
+ ]
+ },
+ "delivery": {
+ "kind": "targeted"
+ },
+ "anchor": "impact",
+ "beats": [
+ {
+ "frame": 5,
+ "name": "flash",
+ "expect": "A pale yellow-white flash and a ground shock ring"
+ },
+ {
+ "frame": 40,
+ "name": "fireball",
+ "expect": "An orange fireball rolls up out of dark soot; lobes break off it"
+ },
+ {
+ "frame": 100,
+ "name": "smoke",
+ "expect": "The fire has gone dark red inside brown-grey smoke; dust rolls along the ground"
+ },
+ {
+ "frame": 200,
+ "name": "column",
+ "expect": "A smoke column keeps climbing over the target; debris has landed"
+ },
+ {
+ "frame": 330,
+ "name": "exit",
+ "expect": "The column is still climbing and widening as it thins out"
+ }
+ ],
+ "layer_plan": [
+ {
+ "name": "0:Heat haze",
+ "role": "heat",
+ "primitive": "heat_haze BackDistortion",
+ "exit": "fades by absolute frame 180"
+ },
+ {
+ "name": "1:Smoke column",
+ "role": "residue",
+ "primitive": "soft smoke T_SmokeSheet02 (photographic), climbing",
+ "exit": "thins out by absolute frame 345"
+ },
+ {
+ "name": "2:Soot body",
+ "role": "dark",
+ "primitive": "Blend T_FireballSootSheet01 flipbook under the fire",
+ "exit": "fades by absolute frame 188"
+ },
+ {
+ "name": "3:Fireball",
+ "role": "body",
+ "primitive": "additive T_FireballSheet01 flipbook, photographic colour ramp",
+ "exit": "cools out by absolute frame 148"
+ },
+ {
+ "name": "4:Fire lobes",
+ "role": "break-up",
+ "primitive": "additive T_FireballSheet01 lobes sprayed off the ball",
+ "exit": "cool out by absolute frame 140"
+ },
+ {
+ "name": "5:Contact flash",
+ "role": "contact",
+ "primitive": "Sprite T_Flare01, pale yellow-white",
+ "exit": "gone by absolute frame 12"
+ },
+ {
+ "name": "6:Bloom",
+ "role": "light",
+ "primitive": "Sprite T_Glow01",
+ "exit": "gone by absolute frame 18"
+ },
+ {
+ "name": "7:Ground pivot",
+ "role": "placement",
+ "primitive": "None pivot at floor height",
+ "exit": "ends by absolute frame 300"
+ },
+ {
+ "name": "7:Ground pivot/0:Dust skirt",
+ "role": "ground",
+ "primitive": "soft smoke T_SmokeSheet02 rolling out along the floor (Circle spawn, +X travel)",
+ "exit": "settles by absolute frame 235"
+ },
+ {
+ "name": "8:Shock ring",
+ "role": "shock",
+ "primitive": "shock_ring on the ground",
+ "exit": "gone by absolute frame 45"
+ },
+ {
+ "name": "9:Shock refraction",
+ "role": "shock",
+ "primitive": "distortion_ring",
+ "exit": "gone by absolute frame 45"
+ },
+ {
+ "name": "10:Embers streaks",
+ "role": "secondary",
+ "primitive": "spark_burst tiers",
+ "exit": "cool and fade by absolute frame 30"
+ },
+ {
+ "name": "11:Embers",
+ "role": "secondary",
+ "primitive": "spark_burst tiers",
+ "exit": "cool and fade by absolute frame 105"
+ },
+ {
+ "name": "12:Embers heavy",
+ "role": "secondary",
+ "primitive": "spark_burst tiers",
+ "exit": "cool and fade by absolute frame 125"
+ },
+ {
+ "name": "13:Debris",
+ "role": "matter",
+ "primitive": "debris chunks with floor collision",
+ "exit": "land and fade by absolute frame 205"
+ }
+ ],
+ "acceptance": [
+ "Colours match a daylight photograph: no pure white body, no saturated red-pink, soot is warm near black",
+ "Smoke outlasts the fire and keeps moving up",
+ "Smoke meets the ground without a hard horizontal edge"
+ ],
+ "avoid": [
+ "A glowing ball that only scales and fades",
+ "Cartoon puffs",
+ "Smoke cut off by a straight line at the floor"
+ ]
+}
diff --git a/skills/effekseer-vfx/assets/examples/catalog.json b/skills/effekseer-vfx/assets/examples/catalog.json
index f4c7ebc..b73c73a 100644
--- a/skills/effekseer-vfx/assets/examples/catalog.json
+++ b/skills/effekseer-vfx/assets/examples/catalog.json
@@ -1,5 +1,5 @@
{
- "note": "Four ranged pairs (a projectile and the impact played where it arrives) and five single effects, one per common category. Scores and verdicts are an independent review (0-3 per rubric criterion) of renders in the skill's default capsule Lab, kept as a reference, not as verification of your build.",
+ "note": "Four ranged pairs (a projectile and the impact played where it arrives), five single effects, one per common category, and the kaiju set (world scale, a sweepable beam with its charge, a photographic explosion). Scores and verdicts are an independent review (0-3 per rubric criterion) of renders in the skill's default capsule Lab, kept as a reference, not as verification of your build.",
"pairs": [
{
"name": "fire",
@@ -179,6 +179,36 @@
"placement": 3,
"tail": 2,
"identity": 2
+ },
+ "VFX_Kaiju_Atomic_Charge": {
+ "read": 2,
+ "timing": 2,
+ "layering": 2,
+ "shape_change": 2,
+ "motion": 2,
+ "placement": 2,
+ "tail": 2,
+ "identity": 2
+ },
+ "VFX_Kaiju_Atomic_Beam": {
+ "read": 2,
+ "timing": 2,
+ "layering": 3,
+ "shape_change": 2,
+ "motion": 2,
+ "placement": 2,
+ "tail": 2,
+ "identity": 2
+ },
+ "VFX_Kaiju_Explosion": {
+ "read": 2,
+ "timing": 3,
+ "layering": 3,
+ "shape_change": 3,
+ "motion": 3,
+ "placement": 3,
+ "tail": 2,
+ "identity": 3
}
},
"singles": [
@@ -233,6 +263,23 @@
]
}
],
+ "sets": [
+ {
+ "name": "kaiju",
+ "effects": [
+ "VFX_Kaiju_Atomic_Charge",
+ "VFX_Kaiju_Atomic_Beam",
+ "VFX_Kaiju_Explosion"
+ ],
+ "teaches": [
+ "scale='kaiju': recipes written at character scale, built 40x larger and 2.5x slower (references/scale.md)",
+ "charge_chain(): arcs lighting a chain of anchors one after another, re-struck mirrored",
+ "beam(): a sustained beam whose length and power the game drives through bind equations (Vfx.beam(), aim(), release())",
+ "photographic colour and brightness for fire, soot and smoke (references/realism.md)",
+ "soft particles where smoke meets the ground"
+ ]
+ }
+ ],
"historical_review": {
"date": "2026-10-10",
"stage": "the skill's default Lab (capsule stand-ins, standard view, default profile)",
@@ -250,7 +297,10 @@
"VFX_Slash_Fire": "ship",
"VFX_Magic_Charge": "ship",
"VFX_Shield_Dome": "ship",
- "VFX_Heal": "ship"
+ "VFX_Heal": "ship",
+ "VFX_Kaiju_Atomic_Charge": "ship",
+ "VFX_Kaiju_Atomic_Beam": "ship",
+ "VFX_Kaiju_Explosion": "ship"
},
"worst": {
"VFX_Projectile_Fire": {
@@ -304,8 +354,20 @@
"VFX_Heal": {
"criterion": "layering",
"fix": "At the plateau f31-f40 the column is one flat mint green; add a white-hot inner core streak rising through the caster's body and a deeper teal/darker green outer fringe on the column edges so the peak tile shows core, body and rim."
+ },
+ "VFX_Kaiju_Atomic_Charge": {
+ "criterion": "placement",
+ "fix": "Raise the mouth-gather orb, its spark spray and the f161-f163 handover flash/streak by about half a head height and pull them back toward the face, so from f116 to f163 they sit on the head's mouth instead of floating in front of the neck/upper chest; keep the arc from the top plate ending on that new point."
+ },
+ "VFX_Kaiju_Atomic_Beam": {
+ "criterion": "shape_change",
+ "fix": "From f30 to f224 the beam body reads as a static rigid rod (f72, f113, f160 and f225 show the same uniform line, with only the endpoint moving). Give the blue body layer a streaky noise texture that scrolls outward along the beam's UV, and add a slight width pulse of about +/-15% every 8-12 frames, so streams visibly travel from the mouth to the impact. Keep the white core line steady so the layering stays intact."
+ },
+ "VFX_Kaiju_Explosion": {
+ "criterion": "tail",
+ "fix": "The smoke column is thin translucent wisps by f288 and the frame is completely empty from about f312 to f351 (the last ~0.6 s). Stretch the smoke column layer's alpha fade and lifetime so a faint, still-rising and thinning column remains through f340 and reaches zero only at f345, instead of finishing around f300."
}
},
- "note": "VFX_Projectile_Ice and VFX_Projectile_Dark were judged iterate: they are complete, buildable examples with a known weakest point, not finished baselines."
+ "note": "VFX_Projectile_Ice and VFX_Projectile_Dark were judged iterate: they are complete, buildable examples with a known weakest point, not finished baselines. The kaiju set was reviewed on 2026-10-12 the same way (independent subagents that saw only the strips, key-frame sheets, manifest entries and flags), on its own renders in the scaled Lab."
}
}
diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Atomic_Beam.py b/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Atomic_Beam.py
new file mode 100644
index 0000000..5e7be7f
--- /dev/null
+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Atomic_Beam.py
@@ -0,0 +1,27 @@
+"""VFX_Kaiju_Atomic_Beam: a sustained atomic breath that the game aims and sweeps (Vfx.beam()).
+
+Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it
+like any other effect; its historical review does not carry over to your edits.
+"""
+from vfxkit.primitives import *
+
+
+def recipe():
+ pale = (230, 246, 255, 255); blue = (60, 150, 255, 255); rim = (25, 60, 220, 130)
+ breath = beam('Breath', pale, blue, rim, width=.55, interval=6, flow=.06, origin=1.1, end=1.5, sparks=6,
+ steam=(205, 215, 225, 150), steam_life=(40, 50), scorch=(170, 215, 255, 220), scorch_life=50)
+ # What the beam touched keeps smouldering after it shuts off: dark smoke left along the raked path (inherits the hit
+ # point only at birth) that thins slowly and carries the last third of the effect (reviews found it empty).
+ hit_point = breath[-1]
+ hit_point['children'].append(smoke('Breath smoulder', (58, 54, 52, 175), count=1, size=(.9, 1.2), grow=1.8, life=(56, 60), speed=(.003, .006),
+ rise=.0002, texture='T_SmokeSheet02', inherit=TRAIL, soft=.3, color_end=(58, 54, 52, 120), fade_out=8,
+ spawn=dict(shape='Sphere', radius=[0, .2], rotate=False), rotation=[0, 0, [-12, 12]], spin=[0, 0, [-.1, .1]],
+ flipbook=dict(x=4, y=4, frame_length=6, loop='Once')))
+ return effect('Kaiju_Atomic_Beam', 'Kaiju Atomic Beam', 'beam', 'atomic', 2.52, [
+ *breath,
+ # Ignition: the contact frame at the mouth and a shock bubble that the beam punches out of.
+ flash('Ignition flash', WHITE, 2.2, life=5, delay=1),
+ shell('Ignition shell', (150, 205, 255, 200), 1.2, life=14, delay=1),
+ ], attach='caster', peak=.03, impact=.6, light=(.55, .75, 1), delivery=dict(kind='beam', charge='VFX_Kaiju_Atomic_Charge'),
+ hold=1.5, inputs=beam_inputs(160), scale='kaiju',
+ design='A white-hot line inside a saturated blue beam with a wide dim rim; noise streams outward along it, steam, sparks, cooling scorch and smouldering smoke stay where it lands, and it stays locked to its end point while the game rakes it.')
diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Atomic_Charge.py b/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Atomic_Charge.py
new file mode 100644
index 0000000..7e147eb
--- /dev/null
+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Atomic_Charge.py
@@ -0,0 +1,61 @@
+"""VFX_Kaiju_Atomic_Charge: dorsal plates light up from the tail to the head before an atomic breath.
+
+Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it
+like any other effect; its historical review does not carry over to your edits.
+"""
+from vfxkit.primitives import *
+
+# Plates on the caster dummy's back surface, from the hips to the back of the head, then the mouth, relative to the
+# caster anchor (1.2 m above the feet, Lab metres; scale='kaiju' makes the chain about 30 m long). The dummy faces +x, so
+# its back is at x = -0.27. A game with a real monster replaces these with its plate positions.
+SPINE = [(-.27, -.36, 0), (-.29, -.2, .03), (-.3, -.04, -.03), (-.29, .12, .03), (-.27, .27, -.02), (-.2, .42, .02)]
+MOUTH = (.45, .1, .12) # where the Lab's beam leaves the caster (VfxLab MUZZLE)
+
+
+def recipe():
+ pale = (225, 245, 255, 255); blue = (70, 150, 255, 255); deep = (30, 70, 220, 200)
+ # One plate every 8 frames (20 at kaiju time): the lit column is still climbing when the mouth starts to gather.
+ step = 8
+ chain = charge_chain('Plates', SPINE + [MOUTH], blue, pale, step=step, until=64, width=.32, glow=.34, restrike=3)
+ # Each plate throws a few sparks as it ignites: the climb reads as a chain of small discharges, not a fade-in.
+ kicks = [radial_sparks(f'Plate {i + 1} sparks', 4, pale, color_end=blue, distance=(.12, .3), life=(8, 12), delay=i * step, width=.04,
+ length=(.12, .22), position=list(at)) for i, at in enumerate(SPINE)]
+ # Each plate is a solid shape that switches on: a six-sided crystal fin leaning up and back from the spine. The whole
+ # row is there, dim blue-grey, from the first frame (so the read is "plates on a back" at once); each fin pops white
+ # when its turn comes, then holds a steady blue with a slow flicker. Separate lit fins make the climb read step by
+ # step. On a real monster whose plates glow through their material, drop the fins and keep the arcs.
+ # Emissive stays below 1: brighter fins overlap into one bloom blob and the separate shapes are lost.
+ fin = (40, 95, 230, 255); dim = (70, 90, 120, 110); life = 72
+
+ def fin_curve(born):
+ lit = 100 * born / life
+ stops = ([(0, dim), (lit, dim)] if lit > 0 else []) + [(lit + 2, pale), (lit + 12, fin), (min(99, lit + 40), (70, 130, 245, 255)), (100, fin)]
+ return ramp(*stops)['color_curve']
+ fins = [crystal(f'Plate {i + 1} fin', fin, .3 + .045 * min(i, 4), .08, life, edge=(150, 210, 255, 255),
+ position=[at[0] - .04, at[1], at[2]], rotation=[0, 0, 55], fade_in=0, fade_out=6, emissive=.7,
+ color_curve=fin_curve(i * step))
+ for i, at in enumerate(SPINE)]
+ return effect('Kaiju_Atomic_Charge', 'Kaiju Atomic Charge', 'charge', 'atomic', 1.35, [
+ # Ionised air around the back thickens as the plates light: a dim volume the arcs crackle through.
+ glow('Back glow', deep, 1.2, life=66, delay=4, position=[-.3, .02, 0], size_curve=[[0, .3], [70, 1], [100, 1.15]], fade_in=20, fade_out=6),
+ *fins, *chain, *kicks,
+ # The mouth gathers the charge at the end of the chain: a saturated blue body round a small white core,
+ # gone a few frames after the flash so nothing lingers as a static orb.
+ glow('Mouth body', blue, .8, life=28, delay=40, position=list(MOUTH), size_curve=[[0, .2], [85, 1], [100, 1.3]], fade_in=8, fade_out=4, emissive=1.4),
+ glow('Mouth core', pale, .35, life=26, delay=42, position=list(MOUTH), size_curve=[[0, .2], [85, 1], [100, .6]], fade_in=6, fade_out=3, emissive=2.2),
+ # Energy drawn into the mouth for the last second: streaks spawn on a shell round it and accelerate inward,
+ # faster and denser toward the release, so the mouth gathers rather than just swelling.
+ # They hang under a pivot at the mouth: with rotate=True emission, `travel` (and a `position`) are in each
+ # particle's rotated frame, so a position on the streak itself scattered them outward.
+ dict(name='Mouth pivot', renderer='None', life=66, position=list(MOUTH), children=[
+ radial_sparks('Mouth gather', 30, pale, color_end=blue, life=(10, 14), delay=40, interval=.8, width=.06,
+ length=(.25, .4), spawn=dict(shape='Sphere', radius=[.6, .8]), easing='EaseInCubic',
+ travel=dict(end=[0, [-.78, -.6], 0], easing='EaseInCubic'), fade_in=2, fade_out=3, emissive=2.0)]),
+ motes('Ion motes', 22, pale, color_end=blue, life=(14, 22), interval=2, size=(.04, .08), delay=6, radius=(0, .2),
+ spawn=dict(shape='Sphere', radius=[.05, .2]), position=[-.32, .02, 0], distance=(.15, .4), turbulence=.002),
+ flash('Charged flash', WHITE, 2.4, life=5, delay=64, position=list(MOUTH)),
+ # The release throws sparks forward along the coming beam and leaves a short-lived afterglow on the plates.
+ radial_sparks('Release sparks', 14, pale, color_end=blue, distance=(.4, 1.1), life=(10, 16), delay=64, position=list(MOUTH), width=.05),
+ glow('Plate afterglow', deep, 1.0, life=16, delay=64, position=[-.3, .02, 0], fade_in=0, fade_out=12),
+ ], attach='caster', peak=1.07, impact=.35, light=(.55, .75, 1), delivery=SELF, scale='kaiju',
+ design='Crystal plates on the back switch on one by one from the hips to the head, each with a spark and an arc jumping to the next, and stay lit, until the mouth gathers a blue glow and one flash hands over to the beam.')
diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Explosion.py b/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Explosion.py
new file mode 100644
index 0000000..cfe1c96
--- /dev/null
+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Kaiju_Explosion.py
@@ -0,0 +1,65 @@
+"""VFX_Kaiju_Explosion: a photographic, building-sized fuel explosion for a kaiju battle (realistic, not stylised).
+
+Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it
+like any other effect; its historical review does not carry over to your edits.
+"""
+from vfxkit.primitives import *
+
+# Colours sampled from daylight photographs of fuel explosions (references/realism.md): the core is a pale
+# yellow-white, not pure white; the body is orange, the cooling edge a deep red-orange; soot is a warm near black
+# and the smoke column a brown-grey that is lighter where the sun hits its top.
+CORE = (255, 244, 214, 255)
+FIRE = (255, 168, 72, 255)
+EDGE = (214, 84, 28, 255)
+SOOT = (38, 32, 29, 235)
+SMOKE = (92, 84, 78, 215)
+DUST = (150, 136, 118, 170)
+
+
+def recipe():
+ floor = -1.3 # the impact anchor sits 1.35 m above the floor (before scale)
+ fire = ramp((0, FIRE), (40, EDGE), (75, (120, 40, 18, 160)), (100, (60, 20, 10, 0)))
+ return effect('Kaiju_Explosion', 'Kaiju Explosion', 'explosion', 'fire', 2.3, [
+ heat_haze('Heat haze', 4.2, life=70, delay=2, strength=.7),
+ # Draw order back to front: the smoke column and the soot body come before the fire, so the fire burns in front
+ # of its own smoke instead of being punched out by it.
+ # The column outlives the fire: it keeps being fed for the first second, holds most of its density over life
+ # (colour_end keeps 40% alpha) and is still climbing and widening when the effect ends.
+ smoke('Smoke column', SMOKE, count=9, size=(2.3, 3.0), grow=2.0, life=(84, 90), delay=8, interval=5, speed=(.004, .009), rise=.00012,
+ texture='T_SmokeSheet02', position=[0, .4, 0], soft=.5, color_end=fade(SMOKE, 90), fade_out=24,
+ # rotate=False: the velocity stays world-up; with the default sphere rotation each puff flies off along
+ # its own random spawn direction and the column drifts sideways and sinks.
+ spawn=dict(shape='Sphere', radius=[0, .6], rotate=False),
+ # Photographic smoke is lit from above: keep the lit tops up (a full random roll turns puffs upside down
+ # and swings the off-centre billows sideways).
+ rotation=[0, 0, [-12, 12]], spin=[0, 0, [-.1, .1]],
+ # A slower flipbook stops before the sheet's last, nearly empty cells: the column is still dense at the end.
+ flipbook=dict(x=4, y=4, frame_length=8, loop='Once')),
+ sprite('Soot body', 'T_FireballSootSheet01', SOOT, color_end=fade(SOOT), life=70, delay=5, size=3.2, size_curve=[[0, .45], [25, .9], [100, 1.2]],
+ blend='Blend', billboard='RotatedBillboard', rotation=[0, 0, 20], flipbook=dict(x=4, y=4, frame_length=4, loop='Once'),
+ velocity=[0, .006, 0], fade_in=2, fade_out=30),
+ # The white-hot moment is the contact flash alone (one spike); the fireball starts orange on its third cell.
+ sprite('Fireball', 'T_FireballSheet01', **fire, life=58, delay=1, size=3.0, size_curve=[[0, .25], [18, .85], [100, 1.15]],
+ billboard='RotatedBillboard', rotation=[0, 0, 20], flipbook=dict(x=4, y=4, frame_length=4, start=2, loop='Once'),
+ velocity=[0, .005, 0], fade_in=0, fade_out=14, emissive=.85),
+ # Secondary lobes rolling off the main ball: the silhouette breaks up instead of growing as one disc.
+ sprite('Fire lobes', 'T_FireballSheet01', **ramp((0, FIRE), (60, EDGE), (100, (90, 30, 12, 0))), count=3, life=[40, 52], delay=4,
+ size=[1.2, 1.7], billboard='RotatedBillboard', rotation=[0, 0, [-180, 180]], flipbook=dict(x=4, y=4, frame_length=3, loop='Once'),
+ **spray([[-1.5, 1.5], [.2, 1.6], [-.6, .6]], .2), fade_in=0, fade_out=12, emissive=1.6),
+ flash('Contact flash', CORE, 4.5, life=4, delay=1),
+ # Short: the white contact is one spike; by frame 8 (20 at kaiju time) the orange body has taken over.
+ glow('Bloom', (255, 190, 110, 140), 3.5, life=6, delay=1),
+ # Ground dust skirt rolling out along the floor and the shock ring that throws it.
+ dict(name='Ground pivot', renderer='None', life=120, position=[0, floor + .05, 0], children=[
+ smoke('Dust skirt', DUST, count=10, size=(1.4, 1.9), grow=1.8, life=(60, 90), delay=4, speed=(0, 0), rise=.0002,
+ rotation=[0, 0, [-12, 12]], spin=[0, 0, [-.1, .1]],
+ spawn=dict(shape='Circle', radius=[.4, .8], division=8), travel=dict(end=[[2.4, 3.4], 0, 0], easing='EaseOutCubic'),
+ texture='T_SmokeSheet02', soft=.35),
+ ]),
+ shock_ring('Shock ring', (255, 210, 160, 150), 6.0, life=16, delay=2, ground=True, position=[0, floor + .08, 0]),
+ distortion_ring('Shock refraction', 5.0, life=16, delay=2, strength=1.0),
+ *spark_burst('Embers', 18, (255, 200, 120, 255), (200, 70, 20, 255), distance=(1.6, 3.6), life=(24, 40), delay=2, gravity=.0012),
+ debris('Debris', 8, [[-3.0, 3.0], [.6, 3.0], [-1.2, 1.2]], color=(46, 41, 38, 255), size=(.1, .22), life=(50, 80), gravity=.0035,
+ floor=floor + .05, delay=2),
+ ], attach='impact', peak=.03, impact=.9, light=(1, .72, .45), delivery=TARGETED, scale='kaiju',
+ design='A pale yellow-white flash becomes an orange fireball rolling up out of its own soot, lobes break off it, a dust skirt rolls along the ground and a brown-grey smoke column keeps climbing after the fire is gone.')
diff --git a/skills/effekseer-vfx/assets/examples/texture_prompts.json b/skills/effekseer-vfx/assets/examples/texture_prompts.json
index 18341ef..8663884 100644
--- a/skills/effekseer-vfx/assets/examples/texture_prompts.json
+++ b/skills/effekseer-vfx/assets/examples/texture_prompts.json
@@ -134,6 +134,46 @@
],
"prompt": "Use case: real-time game VFX FLIPBOOK sprite sheet. Square 1024x1024 image divided into an exact, invisible 4x4 grid of sixteen equal square cells (256x256 each), read left-to-right, top-to-bottom. Each cell is one frame of the SAME seamlessly LOOPING FLAME tongue, monochrome WHITE/gray on pure BLACK. A single stylized fire flame rising from a rounded base at the bottom-center of each cell, licking upward with 2-3 sharp curling prongs; across the 16 frames the prongs flicker, sway left and right, split off a small detached wisp that rises and vanishes, and the cycle returns to frame 1 shape so it loops. Bright white hot core near the base, grayer thinner tips. Same size and same base position in every cell, with black margin so nothing touches cell borders. Grayscale only, hand-painted stylized AAA fantasy game VFX. No grid lines, no numbers, no text, no borders, no scene, no logs, no ground, no character, no color.",
"source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"
+ },
+ {
+ "id": "T_ArcStrand01",
+ "size": "256x512",
+ "prompt": "Use case: real-time game VFX texture mask. Asset type: ELECTRIC ARC STRAND to be stretched between two points. Square 1024x1024 image, pure BLACK background, grayscale only, WHITE light. One single jagged electric discharge arc running straight VERTICALLY from the exact bottom center edge to the exact top center edge of the canvas (it must touch both the top and bottom edges at the horizontal center). Thin intensely white core with sharp angular zigzags that stay within the middle 40% of the width, 4-6 short thin forked side branches that end in empty black, slight soft faint glow hugging the core only. Photographic plasma discharge / Jacob's ladder look, not cartoon. No text, no frame, no other objects, nothing touching the left or right edges.",
+ "post": "middle half of the width cropped at full height (both ends stay on the centre line), resized to 256x512, alpha = luminance (black point 0.03, white at 0.83), RGB white",
+ "source": "image generation model; processed copy only (the original is not shipped)"
+ },
+ {
+ "id": "T_SmokeSheet02",
+ "size": 1024,
+ "grid": [
+ 4,
+ 4
+ ],
+ "prompt": "Use case: real-time game VFX FLIPBOOK sprite sheet. Square 1024x1024 image divided into an exact, invisible 4x4 grid of sixteen equal square cells (256x256 each), read left-to-right, top-to-bottom. Each cell is one animation frame of the SAME photorealistic billowing SMOKE PLUME seen from the side, like a real large explosion's dark smoke column photographed in daylight: dense rolling cauliflower billows with soft self-shadowed interior, lit from the upper left so tops are light grey and undersides are dark grey, wispy torn edges. Frame 1: small dense compact puff in the center of its cell. Frames 2-8: billows grow, roll outward and upward. Frames 9-16: the plume keeps expanding while thinning, becoming transparent wisps that break apart and fade to nothing by frame 16. Grayscale only (white, greys, near black shading) on a pure BLACK background; each frame stays fully inside its own cell with a black margin, never touching the cell border. No grid lines, no text, no fire.",
+ "post": "resized to 1024 keeping the 4x4 cells; RGB = luminance/0.75 ^0.8 (lit shading kept for Blend tinting), alpha = density silhouette (max of luminance and its 2 px blur, 0.03..0.2), cell edges feathered 6 px",
+ "source": "image generation model; processed copy only (the original is not shipped)"
+ },
+ {
+ "id": "T_FireballSheet01",
+ "size": 1024,
+ "grid": [
+ 4,
+ 4
+ ],
+ "prompt": "Use case: real-time game VFX FLIPBOOK sprite sheet. Square 1024x1024 image divided into an exact, invisible 4x4 grid of sixteen equal square cells (256x256 each), read left-to-right, top-to-bottom. Each cell is one animation frame of the SAME photorealistic EXPLOSION FIREBALL, like a high-speed film photograph of a real fuel explosion, rendered as a monochrome LUMINANCE mask: brightest white where the fire is hottest, mid greys for cooler turbulent fire, dark grey for soot-covered rolling surfaces. Frame 1: small blinding white compact core. Frames 2-6: the fireball expands fast into a turbulent rolling mass of many small convection cells, hot white-grey inside, with dark soot veins and darker crust forming on its edges. Frames 7-12: growth slows, the surface darkens and becomes mostly dark grey smoke with a few remaining bright pockets. Frames 13-16: dark, faint, torn remnants fading away to black. Grayscale only on a pure BLACK background; each frame stays fully inside its own cell with a black margin, never touching the cell border. No grid lines, no text, no ground, no debris.",
+ "post": "resized to 1024 keeping the 4x4 cells; RGB white, alpha = ((luminance-0.04)/0.96)^1.25 (emission mask for the additive fire), cell edges feathered 6 px",
+ "source": "image generation model; processed copy only (the original is not shipped)"
+ },
+ {
+ "id": "T_FireballSootSheet01",
+ "size": 1024,
+ "grid": [
+ 4,
+ 4
+ ],
+ "prompt": "Use case: real-time game VFX FLIPBOOK sprite sheet. Square 1024x1024 image divided into an exact, invisible 4x4 grid of sixteen equal square cells (256x256 each), read left-to-right, top-to-bottom. Each cell is one animation frame of the SAME photorealistic EXPLOSION FIREBALL, like a high-speed film photograph of a real fuel explosion, rendered as a monochrome LUMINANCE mask: brightest white where the fire is hottest, mid greys for cooler turbulent fire, dark grey for soot-covered rolling surfaces. Frame 1: small blinding white compact core. Frames 2-6: the fireball expands fast into a turbulent rolling mass of many small convection cells, hot white-grey inside, with dark soot veins and darker crust forming on its edges. Frames 7-12: growth slows, the surface darkens and becomes mostly dark grey smoke with a few remaining bright pockets. Frames 13-16: dark, faint, torn remnants fading away to black. Grayscale only on a pure BLACK background; each frame stays fully inside its own cell with a black margin, never touching the cell border. No grid lines, no text, no ground, no debris.",
+ "post": "same original as T_FireballSheet01; RGB = 0.3 + 0.7 * luminance/0.8 (soot shading), alpha = silhouette (max of luminance and its 2 px blur, 0.03..0.16): the opaque body drawn under the fire with Blend",
+ "source": "image generation model; processed copy only (the original is not shipped)"
}
]
}
diff --git a/skills/effekseer-vfx/assets/examples/textures/T_ArcStrand01.png b/skills/effekseer-vfx/assets/examples/textures/T_ArcStrand01.png
new file mode 100644
index 0000000..7bdbe25
Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_ArcStrand01.png differ
diff --git a/skills/effekseer-vfx/assets/examples/textures/T_FireballSheet01.png b/skills/effekseer-vfx/assets/examples/textures/T_FireballSheet01.png
new file mode 100644
index 0000000..50dc215
Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_FireballSheet01.png differ
diff --git a/skills/effekseer-vfx/assets/examples/textures/T_FireballSootSheet01.png b/skills/effekseer-vfx/assets/examples/textures/T_FireballSootSheet01.png
new file mode 100644
index 0000000..fdfd32d
Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_FireballSootSheet01.png differ
diff --git a/skills/effekseer-vfx/assets/examples/textures/T_SmokeSheet02.png b/skills/effekseer-vfx/assets/examples/textures/T_SmokeSheet02.png
new file mode 100644
index 0000000..ab33f99
Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_SmokeSheet02.png differ
diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/TestApi.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/TestApi.gd
index c028846..5714a58 100644
--- a/skills/effekseer-vfx/assets/godot-lab/scripts/TestApi.gd
+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/TestApi.gd
@@ -58,5 +58,25 @@ func _run() -> void:
check(not is_instance_valid(shot) or shot.released,"projectile releases on arrival")
await create_timer(float(manager.effects[projectile_id].duration)+0.5).timeout
check(not is_instance_valid(shot),"released projectile frees after its trail dies")
+ # Beams aim from a point at a point: the handle's +Y follows the target, @In0 carries the distance in the effect's
+ # own units, power ramps up on ignition and down after release, and the handle frees itself afterwards.
+ var beam_id := ""
+ for item in manager.manifest:
+ if item.get("delivery", {}).get("kind", "") == "beam": beam_id = item.id
+ if beam_id != "":
+ var origin := Vector3(-2, 1, 0)
+ var ray: CombatVfxHandle = manager.beam(beam_id, origin, Vector3(2, 1, 0))
+ check(is_instance_valid(ray) and ray.beam_mode, "beam returns a beam handle")
+ check(is_equal_approx(ray.inputs[0], 4.0), "beam length input is the distance")
+ check(ray.global_basis.y.normalized().is_equal_approx(Vector3.RIGHT), "beam +Y points at the target")
+ await create_timer(0.5).timeout
+ check(is_equal_approx(ray.inputs[1], 1.0), "beam power ramps to 1")
+ ray.aim(origin, Vector3(-2, 4, 0))
+ check(is_equal_approx(ray.inputs[0], 3.0) and ray.global_basis.y.normalized().is_equal_approx(Vector3.UP), "aim re-points and re-measures the beam")
+ ray.release()
+ await create_timer(0.5).timeout
+ check(not is_instance_valid(ray) or (ray.released and ray.inputs[1] < 0.01), "released beam powers down")
+ await create_timer(float(manager.effects[beam_id].duration)+0.5).timeout
+ check(not is_instance_valid(ray), "released beam frees after its last instances fade")
print(JSON.stringify({"api_checks":checks,"failures":failures}))
quit(0 if failures.is_empty() else 1)
diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd
index 01cfa0b..62fe21b 100644
--- a/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd
+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd
@@ -29,6 +29,24 @@ func play(id: String, position: Vector3, rotation: Vector3 = Vector3.ZERO, effec
active.append(handle)
handle.tree_exiting.connect(func(): active.erase(handle))
handle.start(resource,bool(options.get("loop",effects[id].loop)),float(effects[id].duration))
+ # Game inputs (@In0..@In3) the recipe's bind equations read; the handle keeps pushing them every frame.
+ var defaults: Array = effects[id].get("inputs", [])
+ for i in defaults.size(): handle.inputs[i] = float(defaults[i])
+ handle.push_inputs()
+ return handle
+
+## Fire a beam effect (manifest delivery "beam") from `from` at `to`. Call `aim(from, to)` on the handle every frame
+## to sweep it; `release()` stops it: the beam narrows and its last instances fade out. options.ignite (s) is how
+## long the power ramps from 0 to 1 (default 0.08 s, times the recipe's time scale).
+func beam(id: String, from: Vector3, to: Vector3, options: Dictionary = {}) -> CombatVfxHandle:
+ var handle := play(id, from, Vector3.ZERO, Vector3.ONE, {"loop": false})
+ if handle == null: return null
+ var stretch := float(effects[id].get("scale", {}).get("time", 1.0))
+ handle.start_beam(float(options.get("ignite", 0.08 * stretch)), float(options.get("fade", 0.12 * stretch)))
+ handle.aim(from, to)
+ # Before the first simulated frame: particles born on frame 0 (the hit point's spray) must see the real length,
+ # not the recipe's default.
+ handle.push_inputs()
return handle
## Fire a projectile effect from `from` to `to`. Flight time is the manifest `flight` unless
diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd
index 0c1d9c3..7ee9e81 100644
--- a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd
+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd
@@ -3,7 +3,15 @@ extends Node3D
## One controllable game VFX instance. Finite effects clean themselves up;
## looping effects replay their complete recipe until stop() is called.
## Projectiles fly() to a point, emit `arrived` there and release() their trail.
+## Beams aim() from a point at a point; the recipe's bind equations read the length (@In0) and power (@In1).
signal arrived(position: Vector3)
+## Current values of the game inputs @In0..@In3, pushed to the emitter every frame (a value set before the
+## native effect exists would otherwise be lost).
+var inputs: Array[float] = [0.0, 0.0, 0.0, 0.0]
+var beam_mode: bool = false
+var beam_power: float = 1.0
+var ignite_time: float = 0.08
+var fade_time: float = 0.12
var emitter: EffekseerEmitter3D
var loop_enabled: bool = false
var duration: float = 1.0
@@ -46,8 +54,46 @@ func fly(from: Vector3, to: Vector3, seconds: float, arc: float = 0.0) -> void:
flight_elapsed = 0.0
global_position = from
+## Turn this handle into a beam: power ramps 0 -> 1 over `ignite` seconds and back to 0 over `fade` after release().
+func start_beam(ignite: float, fade: float) -> void:
+ beam_mode = true
+ ignite_time = maxf(ignite, 0.0)
+ fade_time = maxf(fade, 0.0)
+ beam_power = 0.0 if ignite_time > 0.0 else 1.0
+ inputs[1] = beam_power
+
+## Point the effect's +Y axis from `from` to `to` and stretch its bound length (@In0) to the distance, in the effect's
+## own units (a scaled handle divides by its scale). Call it every frame to sweep.
+func aim(from: Vector3, to: Vector3) -> void:
+ global_position = from
+ var axis := to - from
+ var length := axis.length()
+ if length < 0.0001: return
+ var y := axis / length
+ var side := Vector3.UP if absf(y.dot(Vector3.UP)) < 0.98 else Vector3.RIGHT
+ var x := side.cross(y).normalized()
+ var z := x.cross(y)
+ var size := scale
+ global_basis = Basis(x * size.x, y * size.y, z * size.z)
+ inputs[0] = length / maxf(size.y, 0.0001)
+
+func set_input(index: int, value: float) -> void:
+ inputs[index] = value
+
+## Send the current inputs to the native effect now (Vfx.play/beam call it right after creating the handle, so the
+## first frame does not use the .efk defaults).
+func push_inputs() -> void:
+ if not is_instance_valid(emitter): return
+ for i in inputs.size(): emitter.set_dynamic_input(i, inputs[i])
+
func _process(delta: float) -> void:
if paused: return
+ if beam_mode:
+ var step := delta * speed
+ if released: beam_power = maxf(0.0, beam_power - step / maxf(fade_time, 0.001)) if fade_time > 0.0 else 0.0
+ else: beam_power = minf(1.0, beam_power + step / maxf(ignite_time, 0.001)) if ignite_time > 0.0 else 1.0
+ inputs[1] = beam_power
+ push_inputs()
elapsed += delta * speed
if flight_elapsed >= 0.0:
flight_elapsed += delta * speed
@@ -77,6 +123,7 @@ func stop() -> void:
queue_free()
func set_dynamic_input(index: int, value: float) -> void:
+ inputs[index] = value
if is_instance_valid(emitter): emitter.set_dynamic_input(index,value)
func send_trigger(index: int) -> void:
diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd
index 51ef28a..d2d2118 100644
--- a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd
+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd
@@ -44,6 +44,8 @@ const ATTACH_OFFSET := {"ground": Vector3(0, 0, 0.12), "body": Vector3(0, 0.95,
# The GLBs are expected 1 unit tall; 1.75 puts the hips at the "body" anchor.
const CHARACTERS := {"PlayerDummy": "res://characters/player.glb", "EnemyDummy": "res://characters/target.glb"}
const CHARACTER_SCALE := 1.75
+# Where a ranged attack leaves the caster (hand or mouth), relative to the caster's feet.
+const MUZZLE := Vector3(0.45, 1.3, 0.12)
# Each faces the other, turned 25° toward the camera so the action reads in three-quarter view.
const CHARACTER_YAW := {"PlayerDummy": 65.0, "EnemyDummy": -65.0}
# Clip times measured from the bone data (hand speed, hips height): the moment each clip is synced to.
@@ -91,6 +93,17 @@ var camera_home: Transform3D
var flash_light: OmniLight3D
var impact_fired: bool = false
var shake: float = 0.0
+# World scale of the selected effect (manifest scale.world): the whole stage, the dummies and the camera grow with it, so
+# a kaiju effect is staged between 70 m dummies and frames the same as a character-scale one.
+var stage_scale: float = 1.0
+var stage: Node3D
+var sun: DirectionalLight3D
+var isolated_camera_base: Transform3D
+var combat_camera_base: Transform3D
+# The beam the current sequence is firing and how it sweeps: two {t, to} keys and the muzzle; released at beam_end.
+var beam_handle: CombatVfxHandle
+var beam_path: Array = []
+var beam_end: float = 0.0
func _ready() -> void:
_build_stage()
@@ -209,7 +222,10 @@ func _build_stage() -> void:
flash_light.light_energy = 0
add_child(flash_light)
add_child(world)
- var sun := DirectionalLight3D.new()
+ stage = Node3D.new()
+ stage.name = "Stage"
+ add_child(stage)
+ sun = DirectionalLight3D.new()
sun.rotation_degrees = Vector3(-48, -25, 0)
sun.light_energy = 1.5
sun.shadow_enabled = true
@@ -222,14 +238,14 @@ func _build_stage() -> void:
add_child(fill)
var plane := PlaneMesh.new()
plane.size = Vector2(100, 100)
- var floor_mesh := _mesh(plane, DARK_FLOOR, Vector3(0, -0.12, 0))
+ var floor_mesh := _mesh(plane, DARK_FLOOR, Vector3(0, -0.12, 0), stage)
floor_material = floor_mesh.material_override
var platform := CylinderMesh.new()
platform.top_radius = 3.0
platform.bottom_radius = 3.0
platform.height = 0.12
platform.radial_segments = 96
- _mesh(platform, Color("2a3848"), Vector3(0, -0.045, 0))
+ _mesh(platform, Color("2a3848"), Vector3(0, -0.045, 0), stage)
# Thin concentric stage markings give a scale reference.
for radius in [1.0, 2.0, 2.95]:
var torus := TorusMesh.new()
@@ -237,7 +253,7 @@ func _build_stage() -> void:
torus.outer_radius = radius + 0.012
torus.rings = 64
torus.ring_segments = 6
- _mesh(torus, Color("5f86a6"), Vector3(0, 0.018, 0))
+ _mesh(torus, Color("5f86a6"), Vector3(0, 0.018, 0), stage)
player = _dummy("PlayerDummy", ISOLATED_PLAYER, Color("5cbbca"), "PLAYER")
enemy = _dummy("EnemyDummy", ISOLATED_ENEMY, Color("d47f66"), "TARGET")
camera = Camera3D.new()
@@ -252,12 +268,27 @@ func _build_stage() -> void:
camera.position = Vector3(0, 3.5, 10.6)
camera.look_at(Vector3(0, 1.25, 0))
combat_camera = camera.transform
+ isolated_camera_base = isolated_camera
+ combat_camera_base = combat_camera
camera.transform = isolated_camera
camera_home = camera.transform
+func _set_stage_scale(value: float) -> void:
+ # Everything in the stage frame scales about the world origin: the camera keeps its view direction and the framing
+ # of the dummies, and every metric measured in stage heights compares across scales.
+ stage_scale = maxf(value, 0.001)
+ stage.scale = Vector3.ONE * stage_scale
+ for dummy in [player, enemy]: dummy.scale = Vector3.ONE * stage_scale
+ isolated_camera = Transform3D(isolated_camera_base.basis, isolated_camera_base.origin * stage_scale)
+ combat_camera = Transform3D(combat_camera_base.basis, combat_camera_base.origin * stage_scale)
+ camera.near = 0.05 * stage_scale
+ camera.far = 4000.0 * stage_scale
+ flash_light.omni_range = 9 * stage_scale
+ sun.directional_shadow_max_distance = 100.0 * stage_scale
+
func _layout() -> void:
- player.position = COMBAT_PLAYER if combat else ISOLATED_PLAYER
- enemy.position = COMBAT_ENEMY if combat else ISOLATED_ENEMY
+ player.position = (COMBAT_PLAYER if combat else ISOLATED_PLAYER) * stage_scale
+ enemy.position = (COMBAT_ENEMY if combat else ISOLATED_ENEMY) * stage_scale
camera_home = combat_camera if combat else isolated_camera
camera.transform = camera_home
# The offset only re-centres the view in the space the side panel leaves free.
@@ -506,15 +537,20 @@ func _select(i: int, start: bool = true) -> void:
if Vfx.manifest.is_empty(): return
index = posmod(i,Vfx.manifest.size())
var item: Dictionary = Vfx.manifest[index]
+ var world := float(item.get("scale", {}).get("world", 1.0))
+ if not is_equal_approx(world, stage_scale):
+ _set_stage_scale(world)
+ _layout()
if capture_mode and review_view == "close":
var self_cast := str(item.get("delivery", {}).get("kind", "")) == "self"
- var focus := (COMBAT_PLAYER if self_cast else COMBAT_ENEMY) + Vector3(0, 1.0, 0)
- camera.position = focus + Vector3(1.4, 2.2, 5.8)
+ var focus := ((COMBAT_PLAYER if self_cast else COMBAT_ENEMY) + Vector3(0, 1.0, 0)) * stage_scale
+ camera.position = focus + Vector3(1.4, 2.2, 5.8) * stage_scale
camera.look_at(focus)
camera_home = camera.transform
if showcase: print(JSON.stringify({"showcase_index":index+1,"id":item.id}))
title.text = "%02d / %s" % [index+1,item.name]
subtitle.text = "%s / %s / %s" % [item.category.to_upper(),item.element.to_upper(),item.id]
+ if stage_scale != 1.0: subtitle.text += " / %s x%s" % [str(item.get("scale", {}).get("profile", "scale")).to_upper(), str(stage_scale)]
info.text = "%.2f s duration • %d layers • ≤ %d particles • %s" % [item.duration,item.layers,item.particle_budget,item.attach.to_upper()]
for j in range(library_list.item_count):
if int(library_list.get_item_metadata(j)) == index:
@@ -526,6 +562,8 @@ func _replay() -> void:
if Vfx.manifest.is_empty(): return
if capture_mode: seed(int(Vfx.manifest[index].get("seed", 1729)))
Vfx.stop_all()
+ beam_handle = null
+ beam_path = []
elapsed = 0
sequence_id += 1
events.clear()
@@ -546,14 +584,14 @@ func _replay() -> void:
sequence_end = float(item.duration)
if item.category == "projectile":
var to := _anchor(item, enemy)
- Vfx.launch(item.id, to + Vector3(-3.2, -0.15, 0), to)
+ Vfx.launch(item.id, to + Vector3(-3.2, -0.15, 0) * stage_scale, to)
return
var at := _anchor(item, player if item.attach.begins_with("caster") else enemy)
Vfx.play(item.id,at,Vector3.ZERO,Vector3.ONE,{"loop":false})
_at(float(item.get("peak", 0.1)), func(): _kick(item, at))
func _anchor(item: Dictionary, actor: Node3D) -> Vector3:
- return actor.position + ATTACH_OFFSET.get(item.attach, ATTACH_OFFSET.impact)
+ return actor.position + ATTACH_OFFSET.get(item.attach, ATTACH_OFFSET.impact) * stage_scale
func _paired_impact(projectile_id: String) -> Dictionary:
for entry in Vfx.manifest:
@@ -605,7 +643,7 @@ func _stage(item: Dictionary) -> void:
_hit_at(elapsed + float(impact_item.peak), impact_item, player))
return
_at(launch_at, func():
- var handle := Vfx.launch(projectile_id, player.position + Vector3(0.45, 1.3, 0.12), to)
+ var handle := Vfx.launch(projectile_id, player.position + MUZZLE * stage_scale, to)
# A projectile's own capture stops at arrival: the paired impact has its own strip and metrics.
if handle == null or impact_item.is_empty() or (capture_mode and item.category == "projectile"): return
handle.arrived.connect(func(_p):
@@ -613,6 +651,27 @@ func _stage(item: Dictionary) -> void:
# Impact begins on the arrival frame; the target reacts at the impact's own peak.
_play(impact_item, _anchor(impact_item, enemy))
_hit_at(elapsed + float(impact_item.peak), impact_item, player)))
+ "beam":
+ # The caster breathes the beam at the ground in front of the target and rakes it up onto the target's chest,
+ # so one take shows ignition, a moving end point, the hit and the release.
+ var charge_id: String = delivery.get("charge", "")
+ var charge: Dictionary = Vfx.effects.get(charge_id, {})
+ var launch_at := 0.2
+ delivery_text = "BEAM · player rakes the beam onto the target" + ((" · after " + charge_id) if not charge.is_empty() else "")
+ _move(player, {"kind": "cast", "t": 0.0})
+ if not charge.is_empty() and not capture_mode:
+ _at(0.0, func(): _play(charge, _anchor(charge, player)))
+ launch_at = float(charge.duration) * 0.85
+ var hold := float(item.get("hold", 1.0))
+ var from := player.position + MUZZLE * stage_scale
+ var near := enemy.position + Vector3(-1.6, 0.0, 0.12) * stage_scale
+ var chest := enemy.position + ATTACH_OFFSET.body * stage_scale
+ beam_path = [{"t": launch_at, "to": near}, {"t": launch_at + hold * 0.7, "to": chest}, {"from": from}]
+ beam_end = launch_at + hold
+ effect_start = launch_at
+ _at(launch_at, func(): beam_handle = Vfx.beam(item.id, from, near))
+ _hit_at(launch_at + float(item.peak), item, player)
+ sequence_end = launch_at + float(item.duration)
"area":
delivery_text = "AREA · the boss slams the ground; the shock wave reaches the player"
var peak := float(item.peak)
@@ -694,7 +753,7 @@ func _pose(actor: Node3D, keys: Array, t: float) -> void:
elif u < land: y = 0.95 * (1.0 - _ease_in((u - up) / (land - up)))
offset.y += y
squash += 0.2 * (1.0 - _smooth(u / 0.08)) * float(u < up) + 0.25 * maxf(0.0, 1.0 - (u - land) / 0.25) * float(u >= land)
- actor.position = (COMBAT_PLAYER if actor == player else COMBAT_ENEMY) + offset if combat else (ISOLATED_PLAYER if actor == player else ISOLATED_ENEMY)
+ actor.position = ((COMBAT_PLAYER if actor == player else COMBAT_ENEMY) + offset if combat else (ISOLATED_PLAYER if actor == player else ISOLATED_ENEMY)) * stage_scale
if actor.has_meta("anim"):
# A rigged character performs the lean and squash through its clips; only the flash stays procedural.
var flash: StandardMaterial3D = actor.get_meta("flash")
@@ -758,13 +817,15 @@ func _kick(item: Dictionary, at: Vector3) -> void:
impact_fired = true
var tint: Array = item.get("light", [1.0, 0.85, 0.6])
flash_light.light_color = Color(tint[0], tint[1], tint[2])
- flash_light.light_energy = 5.0 * power
- flash_light.position = at + Vector3(0.4, 0.5, 1.2)
- shake = 0.16 * power
+ # Godot's omni light falls off as 1/distance (attenuation 1): at stage_scale times the distance it needs
+ # stage_scale times the energy to light the stage the same.
+ flash_light.light_energy = 5.0 * power * stage_scale
+ flash_light.position = at + Vector3(0.4, 0.5, 1.2) * stage_scale
+ shake = 0.16 * power * stage_scale
func _game_feel(delta: float) -> void:
- flash_light.light_energy = move_toward(flash_light.light_energy, 0.0, delta * 22.0)
- shake = move_toward(shake, 0.0, delta * 0.7)
+ flash_light.light_energy = move_toward(flash_light.light_energy, 0.0, delta * 22.0 * stage_scale)
+ shake = move_toward(shake, 0.0, delta * 0.7 * stage_scale)
camera.transform = camera_home
if shake > 0.0:
camera.position += Vector3(randf_range(-shake, shake), randf_range(-shake, shake), 0)
@@ -785,6 +846,7 @@ func _process(delta: float) -> void:
if not Vfx.paused and (not capture_mode or capture_started):
_run_events()
_game_feel(delta)
+ _steer_beam()
# Captures keep the dummies where they stand: a lunge or recoil would count as effect motion in the metrics.
if combat and not capture_mode:
_pose(player, moves.get(player.name, []), elapsed)
@@ -798,6 +860,15 @@ func _process(delta: float) -> void:
else: _select(index+1)
elif looped and not showcase and elapsed > sequence_end+.55: _replay()
+func _steer_beam() -> void:
+ # Sweep the beam's end point between its keys, then release it; captures and playback follow the same clock.
+ if beam_handle == null or not is_instance_valid(beam_handle) or beam_handle.released or beam_path.size() < 3: return
+ var a: Dictionary = beam_path[0]
+ var b: Dictionary = beam_path[1]
+ var u := _smooth(clampf((elapsed - float(a.t)) / maxf(float(b.t) - float(a.t), 0.001), 0.0, 1.0))
+ beam_handle.aim(beam_path[2].from, (a.to as Vector3).lerp(b.to, u))
+ if elapsed >= beam_end: beam_handle.release()
+
func _notification(what: int) -> void:
if what == NOTIFICATION_WM_CLOSE_REQUEST and capture_mode:
print(JSON.stringify({"ignored_close_request":capture_frame}))
diff --git a/skills/effekseer-vfx/references/cli.md b/skills/effekseer-vfx/references/cli.md
index 38c2d80..b914555 100644
--- a/skills/effekseer-vfx/references/cli.md
+++ b/skills/effekseer-vfx/references/cli.md
@@ -26,9 +26,9 @@ outside `EFFEKSEER_VFX_HOME`.
|---|---|---|
| `doctor` | — | platform, toolchain, workspace; `modes` and `next` steps |
| `init [--update-templates] [--no-plugin]` | Python | create/refresh `vfx/` (Lab, materials, math textures, starter painted textures); download the official Effekseer Godot plugin (checksum pinned) |
-| `examples [list]` | — | shipped pairs and single effects with historical scores, verdicts and weakest points |
-| `examples show <name\|ID>` | Python | layer plan with absolute frames and roles (a pair shows both effects) |
-| `examples add <name\|ID\|all> [--force]` | Python | copy example source, brief, painted textures and prompts into the project; names: `fire`, `ice`, `poison`, `dark`, `hit`, `slash`, `charge`, `shield`, `heal` |
+| `examples [list]` | — | shipped pairs, single effects and sets with historical scores, verdicts and weakest points |
+| `examples show <name\|ID>` | Python | layer plan with absolute frames and roles (a pair or set shows every effect) |
+| `examples add <name\|ID\|all> [--force]` | Python | copy example source, brief, painted textures and prompts into the project; names: `fire`, `ice`, `poison`, `dark`, `hit`, `slash`, `charge`, `shield`, `heal`, `kaiju` |
| `procedural` | Python | regenerate the math-primitive textures |
| `list` | Python | effects in `vfx/src` with category, timing, delivery, design and build state; sources that fail to load are listed in `unloaded` |
| `lint [--ids ...] [--timeline]` | Python | static rules (errors) and craft heuristics (warnings), see below |
diff --git a/skills/effekseer-vfx/references/engine-conventions.md b/skills/effekseer-vfx/references/engine-conventions.md
index fd7b001..93acfed 100644
--- a/skills/effekseer-vfx/references/engine-conventions.md
+++ b/skills/effekseer-vfx/references/engine-conventions.md
@@ -4,7 +4,8 @@ Each item below was confirmed in real renders. Use them as they are; do not re-g
behaviour. When you confirm a new convention, add it here with how it was measured.
Contents: angles and axes · forces and motion · meshes and fresnel · textures and flipbooks · inheritance and
-lifetime · rendering, HDR and the Lab · anchors and placement · extending the compiler
+lifetime · game inputs and dynamic equations · rendering, HDR and the Lab · anchors and placement · extending the
+compiler
## Angles and axes
@@ -22,6 +23,14 @@ lifetime · rendering, HDR and the Lab · anchors and placement · extending the
so local **+X** points outward and +Y stays up. Smoke rolling out along the floor needs `travel.end=[[d0,d1],0,0]`;
`[0,d,0]` turns it into a column rising straight up. With `rotate=False` the displacement is in world directions
(use that for rising particles).
+- **Sphere emission with `rotate=True` also rotates PVA `velocity`**: `velocity=[0, v, 0]` flies along each
+ particle's random spawn direction, not up. A smoke column emitted that way drifted sideways and sank (the review's
+ `sinks` flag); `spawn=dict(shape='Sphere', radius=[...], rotate=False)` keeps `velocity` in world directions.
+- **Axial billboards**: `billboard='YAxisFixed'` with `pivot='bottom'` is a quad from the origin along local +Y that
+ turns about that axis to face the camera — a beam that stays wide from any angle except straight down its axis.
+ `DirectionalBillboard` aligns +Y with the particle's motion; with an imperceptible velocity (1e-4 units/frame,
+ `charge_chain`) it aims a stationary sprite at any point without Euler angles (measured: arcs met every anchor of
+ a 7-point chain on a curved spine).
- **`travel.end` is an absolute local position**, not an offset from `position`, and `rotate=True` emission rotates
that local frame too. Put floor-rolling smoke under a `renderer='None'` pivot whose `position` is at floor height;
for world-direction displacement use `spawn rotate=False` (`spray`).
@@ -107,6 +116,21 @@ lifetime · rendering, HDR and the Lab · anchors and placement · extending the
fails to compile (the compiler multiplies the curve by a fixed start scale; lint rejects it). Vary size with a
second layer.
+## Game inputs and dynamic equations
+
+- **`bind` works at runtime in the Godot plugin.** A Fixed location or scale with a dynamic equation
+ (`@O.y = @In0`) is recomputed every frame: a probe changed `@In0` from 3 to 9 to 5 on a playing handle and the
+ beam's length and end flash followed within 2 frames; rotating the emitter re-aimed it. The compiler writes the
+ equations into `Core.Dynamic.Equations` (identical code is shared) and checks them after save/open.
+- **New handles start from the .efk input defaults** (the recipe's `inputs`): on the first simulated frame the kaiju
+ beam's hit-point spray appeared at the default 160 m instead of the real end point. `Vfx.play()` / `Vfx.beam()`
+ therefore push the handle's inputs right after creating it, and `CombatVfxHandle` pushes them again every frame. (An
+ early probe saw zeros only because its .efk had no defaults saved.)
+- **Held bodies**: a beam body is a `held()` cross-fade (an instance every interval, life 2×interval, fades of one
+ interval each) rather than one long-lived instance, so `release()` (`stop_root()`) ends it on time: the kaiju beam
+ narrowed and was gone within about 15 frames of its release in the strips, and `TestApi.gd` checks that a released
+ beam frees itself.
+
## Rendering, HDR and the Lab
- **Screen distortion `material='BackDistortion'`** works in the Godot plugin (`hint_screen_texture`); `distortion` is
@@ -125,9 +149,16 @@ lifetime · rendering, HDR and the Lab · anchors and placement · extending the
`glow()` is a texture layer, not this HDR post-process. Re-render the whole overview after stage changes.
- With strong bloom, effects whose contact is legitimately white-hot report `washed out` on their peak frame; that
lasts 1–3 frames — judge from the strip and do not weaken the contact just to silence the flag.
-- **Soft particles `soft`** were unusable in an earlier Compatibility-renderer Lab (no depth texture; sprites turned
- almost fully transparent). The Lab now uses Forward+, but `soft` has not been re-verified: do not use it and do not
- claim it works.
+- **Soft particles `soft` work in Forward+** (EffekseerForGodot4 1.80.5.1, Godot 4.7.2). The plugin's shader samples
+ `hint_depth_texture` and fades the particle over `soft` world units in front of the opaque depth. Measured on
+ depth-tested cards half sunk into the Lab floor: without `soft` the brightness dropped from 206 to 81 within one
+ pixel at the floor line; with `soft=0.3` it ramped 198 → 188 → 169 → 124 → 81 over about 9 pixels; a card in the air
+ kept exactly the same colour with and without `soft` (216, 198, 155). A `soft` close to the particle size fades the
+ whole card (lint warns). Only opaque geometry is in the depth texture: a transparent water surface must write
+ depth (or have an opaque depth pre-pass) for smoke to soften against it. The Compatibility renderer has no depth
+ texture: there `soft` made sprites almost fully transparent in an earlier Lab — do not use it with Compatibility.
+- **The stage flash at scale**: Godot omni lights fall off as 1/distance (attenuation 1), so the Lab multiplies the
+ flash energy by the stage scale, not its square (with the square a kaiju hit washed out the whole stage).
## Anchors and placement
diff --git a/skills/effekseer-vfx/references/examples.md b/skills/effekseer-vfx/references/examples.md
index 3e61436..448040e 100644
--- a/skills/effekseer-vfx/references/examples.md
+++ b/skills/effekseer-vfx/references/examples.md
@@ -1,7 +1,7 @@
# Shipped examples
-Four ranged pairs (a projectile plus the impact played where it arrives) and five single effects, one per common
-category. They are complete production recipes with design briefs, painted textures (processed copies) and the
+Four ranged pairs (a projectile plus the impact played where it arrives), five single effects, one per common
+category, and the kaiju set. They are complete production recipes with design briefs, painted textures (processed copies) and the
prompts that made them. Their layer roles are the category skeletons in [skeletons](skeletons.md).
| Pair | Projectile | Impact | What it teaches |
@@ -19,9 +19,17 @@ prompts that made them. Their layer roles are the category skeletons in [skeleto
| `shield` | `VFX_Shield_Dome` | fresnel shell and thin rim, overshoot pop, hold with scan bands, `shell_fragments` break that clears on time |
| `heal` | `VFX_Heal` | no impact frame: floor seal, scrolling column, rings, plus signs and motes that all rise and ease out |
+| Set | Effects | What it teaches |
+|---|---|---|
+| `kaiju` | `VFX_Kaiju_Atomic_Charge`, `VFX_Kaiju_Atomic_Beam`, `VFX_Kaiju_Explosion` | `scale='kaiju'` (built 40x larger and 2.5x slower, [scale](scale.md)); `charge_chain()` climbing the dummy's back; a sweepable `beam()` driven by game inputs with steam and scorch left behind; a photographic explosion with soot, a rising smoke column and soft ground dust ([realism](realism.md)) |
+
+The kaiju set is staged between 70 m dummies (the Lab scales its stage with the effect) and its beam is raked from
+the ground in front of the target onto its chest, after the charge.
+
```sh
vfx examples # list with historical scores and verdicts
vfx examples show slash # layer plan, absolute frames, roles, budget (a pair shows both effects)
+vfx examples add kaiju # a set: the charge, the beam and the explosion
vfx examples add fire # copy into vfx/src, vfx/briefs, vfx/textures/processed, vfx/texture_prompts.json
vfx lint --ids VFX_Projectile_Fire VFX_Fire_Explosion
vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion
@@ -31,7 +39,10 @@ vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"
The historical scores (0–3 per rubric criterion) come from an independent review of renders in the skill's default
capsule Lab: two reviewers that saw only the strips, key-frame sheets, manifest entries and flags. Eleven were judged
`ship`; `VFX_Projectile_Ice` (flat lance without a white core or dark rim, no shape change in flight) and
-`VFX_Projectile_Dark` (nothing stays on the path after arrival) were judged `iterate`. `vfx examples` lists every
+`VFX_Projectile_Dark` (nothing stays on the path after arrival) were judged `iterate`. The kaiju set was reviewed the
+same way on its own renders in the scaled Lab and all three were judged `ship` after several rounds (the reviewers'
+fixes: plates on the body, discrete lit fins, an inward mouth gather, smouldering smoke and a column that outlives
+the fire to fill the tails). `vfx examples` lists every
example's weakest criterion and the reviewer's one fix (`historical_review.worst`). The scores are a reference,
**not** verification of your build: re-build, review and score again. Adding an example never overwrites existing
files unless `--force`.
diff --git a/skills/effekseer-vfx/references/godot.md b/skills/effekseer-vfx/references/godot.md
index 06d13bd..fe981d3 100644
--- a/skills/effekseer-vfx/references/godot.md
+++ b/skills/effekseer-vfx/references/godot.md
@@ -23,15 +23,53 @@ shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))
```
Finite effects clean themselves up after `duration`; looping effects replay until `stop()`. The manifest
-(`vfx_manifest.json`) carries `id`, `duration`, `peak`, `impact`, `light`, `delivery`, `flight`, `arc`, `attach` and
-`design`; the Lab uses `impact`/`light`/`peak` for its stage flash and camera kick, which your game implements itself.
+(`vfx_manifest.json`) carries `id`, `duration`, `peak`, `impact`, `light`, `delivery`, `flight`, `arc`, `hold`,
+`inputs`, `scale`, `attach` and `design`; the Lab uses `impact`/`light`/`peak` for its stage flash and camera kick, which your game implements itself.
+
+## Beams
+
+A recipe built with `beam()` (manifest `delivery.kind == "beam"`) is a held effect whose length and power the game
+drives through the inputs its `bind` equations read (`@In0` length in world units, `@In1` power 0–1):
+
+```gdscript
+var ray = Vfx.beam("VFX_Kaiju_Atomic_Beam", mouth.global_position, target_point) # ignites: power 0 -> 1
+func _process(_delta):
+ if is_instance_valid(ray) and not ray.released:
+ ray.aim(mouth.global_position, raycast_hit_point) # every frame: sweep, follow the head, stop at walls
+# when the breath ends:
+ray.release() # the beam narrows (power -> 0) and its last instances fade; the handle frees itself
+```
+
+`aim(from, to)` places the handle at `from`, turns its +Y toward `to` and sets `@In0` to the distance in the
+effect's own units (a scaled handle divides by its scale). `options.ignite` / `options.fade` (seconds) set the power
+ramps; `handle.set_input(index, value)` drives any other input a recipe binds. Sparks, steam and scorch marks are
+emitted in world space, so a sweeping beam leaves them along its path. Let the end point come from a physics ray
+cast so the beam stops on the surface it hits; a game that wants a separate surface impact can still play another
+effect at that point.
+
+Every handle starts from the manifest's `inputs` defaults and pushes its `inputs` to the emitter right away and then
+every frame, so the first frame already uses the real values.
+
+## Scaled effects
+
+An effect built with `scale` (manifest `scale.world`, see [scale](scale.md)) is already in world units: play it at
+scale 1. Make sure the game's Effekseer limits fit kaiju-sized libraries (`[effekseer]` `instance_max_count`,
+`square_max_count` in `project.godot`; the Lab uses 2000 / 8000) and that the camera's far plane covers the effect.
+
+## Soft particles
+
+Layers with `soft` fade where they meet opaque geometry. They need the depth texture of the Forward+ renderer
+(verified; Mobile also has one but is unverified); with Compatibility they turn almost invisible. Transparent surfaces (water) are not in the depth
+texture unless they write depth.
## The Lab
`vfx showcase` (or `godot --path vfx/godot`) opens the Lab: two dummies, PLAYER and TARGET, face each other and every
effect is performed according to its `delivery` — `self` on the caster, `melee` on the target at the strike,
`projectile` flying from caster to target with its impact on arrival, `targeted` called down on the target, `area`
-centred on a boss slam. Keys: ←/→ switch, Space replay, C combat/isolated stage, L loop, P pause, 1–4 speed,
+centred on a boss slam, `beam` fired from the caster's muzzle at the ground in front of the target and raked onto its
+chest (after the charge named in `delivery.charge`, if any). The stage scales with the selected effect's `scale.world`:
+kaiju effects play between 70 m dummies with the camera pulled back by the same factor. Keys: ←/→ switch, Space replay, C combat/isolated stage, L loop, P pause, 1–4 speed,
B background, S auto showcase. `-- --no-glow` disables the HDR bloom for comparison.
The dummies are capsules. Optional rigged stand-ins replace them: put `player.glb` and `target.glb` (about 1 unit
@@ -42,6 +80,6 @@ changes the stage: re-render baselines and re-measure the bloom threshold (see
## Checks
-`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` exercises play, launch, pause, speed, loop
-and auto-recycling against the current manifest. `godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd`
+`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` exercises play, launch, beam (aim, power,
+release), pause, speed, loop and auto-recycling against the current manifest. `godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd`
exports Godot runtime resources. Report these as passing only after running them.
diff --git a/skills/effekseer-vfx/references/primitives.md b/skills/effekseer-vfx/references/primitives.md
index 9bbad42..cf2bd08 100644
--- a/skills/effekseer-vfx/references/primitives.md
+++ b/skills/effekseer-vfx/references/primitives.md
@@ -15,7 +15,7 @@ on top** (the Godot plugin ignores ZWrite between effect layers).
## `effect()` fields
-`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None)`
+`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None, hold=None, inputs=None, scale=None)`
| Field | Meaning |
|---|---|
@@ -24,8 +24,11 @@ on top** (the Godot plugin ignores ZWrite between effect layers).
| `duration`, `peak` | seconds; `peak` is the contact/release moment the Lab flash, kick and target reaction use |
| `attach` | anchor: `ground`, `body`, `impact`, `caster`, `caster_ground`, `projectile` |
| `impact`, `light` | 0–1 strength and RGB of the Lab's stage flash and camera kick (demo staging only) |
-| `delivery` | how a game performs it: `SELF`, `MELEE`, `TARGETED`, `dict(kind='area')`, `dict(kind='projectile')` for the projectile itself, `dict(kind='projectile', projectile='VFX_X')` for its impact |
+| `delivery` | how a game performs it: `SELF`, `MELEE`, `TARGETED`, `dict(kind='area')`, `dict(kind='projectile')` for the projectile itself, `dict(kind='projectile', projectile='VFX_X')` for its impact, `BEAM` or `dict(kind='beam', charge='VFX_X')` for a held beam (the Lab plays the charge first) |
| `flight`, `arc` | projectile only: reference flight seconds and lob height in metres |
+| `hold` | beam only: seconds the Lab fires it before release; `infinite` layers emit until then |
+| `inputs` | default values of the game inputs `@In0..@In3` that `bind` equations read; beams use `beam_inputs(length)` |
+| `scale` | `'giant'`, `'kaiju'`, a number or `{'world','time','budget'}`: build a character-scale recipe for a larger world ([scale](scale.md)) |
| `design` | one sentence of what the player sees; shown in the Lab and given to reviewers |
## Primitives
@@ -59,6 +62,8 @@ nature: contact stars, glows, sparks and smoke puffs (stacked into volume).
| `slice_line` | long thin line at release | `T_Streak01` shooting from 35 % to full length while thinning; `width` is the visible thickness |
| `spray(end)` / `debris` | directional spray along the shot, dark tumbling chunks | non-rotating emission + world-direction `travel` box; Blend `T_Shard01` with gravity, can land |
| `decay(layer, color)` | glow → grey smoke afterimage | copy as Blend grey, `lag` frames later, life × `stretch`, no emissive, slower flow |
+| `beam(name, core, body, rim, width=.5, ...)` | sustained beam the game aims and sweeps (breath weapon, laser, death ray) | axial billboards (`YAxisFixed`, pivot at the base) stretched to `@In0` and widened by `@In1` through `bind`; `T_BeamSection01` cross-section, noise streaming outward, mouth and end flashes, end sparks, optional `steam` and `scorch` left in world space ([godot](godot.md#beams)) |
+| `charge_chain(name, anchors, color, hot, step=4, ...)` | arcs lighting a chain of points one after another (dorsal plates, coils, a ley line) | node glow + pop per anchor at `delay + i*step`; painted `T_ArcStrand01` arcs on a `DirectionalBillboard` aimed at the next anchor by an imperceptible velocity, re-struck mirrored every `restrike` frames until `until` |
## Helpers
@@ -68,6 +73,8 @@ nature: contact stars, glows, sparks and smoke puffs (stacked into volume).
| `fade(color, alpha=0)` | same RGB, new alpha |
| `POP`, `DISSOLVE` | scale curve that snaps then drifts; cutoff easing that holds (ease-in) then erodes |
| `sustain(layer, interval)` | projectile emitter: one instance every `interval` frames until release |
+| `held(layer, interval)` | sustained cross-fade: an instance every `interval` frames, each fading in and out over `interval`, so two always overlap and sum to a constant (a steady beam with no loop seam) |
+| `beam_inputs(length, power=1)`, `BEAM_LENGTH`, `BEAM_POWER`, `BEAM` | the beam's default inputs, the `@In0`/`@In1` names its bind equations use, and its delivery |
| `TRAIL` | inherit position/rotation/scale only when created: the layer stays on the path |
| `slash_set(colors, roll, sweep=(110,260), radius=1.5, offset=(0,0,.5), lean=-18, delay=1, life=14)` | one blade at three widths: a wide dim afterimage two frames late, a saturated body, a thin white-hot edge (`slash_arc`), a refraction arc, and a painted cel crescent (`T_Slash02`, `billboard='Fixed'` in the blade's plane, rotated by the measured `SLASH02_BULGE`); `colors` = (afterimage, body, edge) |
| `swing(layers, yaw, pitch=0)` | wrap blade layers in a `renderer='None'` pivot so the arc cuts through 3D space; yaw about ±30–40° reads as an ellipse rather than a screen crescent |
@@ -76,7 +83,9 @@ nature: contact stars, glows, sparks and smoke puffs (stacked into volume).
## Layer fields
-Beyond PVA, scale and colour the compiler supports: `collide` (floor bounce), `soft` (see engine conventions),
+Beyond PVA, scale and colour the compiler supports: `collide` (floor bounce), `soft` (fade distance in world units
+where the particle meets opaque geometry; verified in Forward+, see engine conventions), `bind` (position/scale
+recomputed every frame from the game inputs, below),
`size` / `size_end` / `size_curve` (uniform scale), `color_end`, `color_curve`, `travel` (eased displacement), `spawn`
(sphere, circle, line emitters), `forces` (gravity, turbulence, vortex), `alpha_texture` + `cutoff` + `edge`
(dissolve with a hot rim), `distortion_texture`, `blend_texture`, `falloff` (fresnel), `flipbook`, `pivot`,
@@ -84,6 +93,15 @@ Beyond PVA, scale and colour the compiler supports: `collide` (floor bounce), `s
accepted key; unknown keys fail with a spelling suggestion. Anything else must be added to the compiler with a
save/open read-back test, not written as raw property paths in a recipe (procedure: [engine conventions](engine-conventions.md#extending-the-compiler)).
+### `bind`: values the game drives
+
+`bind={'position': [x, y, z], 'scale': [x, y, z]}` replaces the layer's position or scale with a Fixed vector that
+an Effekseer dynamic equation recomputes **every frame** from the game inputs `@In0..@In3` (`handle.set_input()` /
+`Vfx.beam()` in Godot). Each component is a number, an equation string (`'@In0'`, `'@In0 * 0.5'`) or a product
+`[k, '@In1']` whose constant `k` scales with the recipe's world scale while the input stays a world value. The
+recipe must give `inputs=[...]` defaults for every input it reads. A bound scale cannot be combined with
+`size`/`scale_*` fields and a bound position not with `travel`/`velocity`; children follow a bound parent.
+
## Units
Layer `life`, `delay`, `interval`: 60 FPS frames. Velocity and acceleration: units per frame; gravity: units per frame².
diff --git a/skills/effekseer-vfx/references/realism.md b/skills/effekseer-vfx/references/realism.md
new file mode 100644
index 0000000..22e38d8
--- /dev/null
+++ b/skills/effekseer-vfx/references/realism.md
@@ -0,0 +1,61 @@
+# Photographic explosions, fire and smoke
+
+Use this when the brief asks for a realistic look (film, live-action reference, a photoreal game) instead of the
+stylized default. The craft rules still apply — time structure, value layering, shape change — but the colours,
+brightness and textures come from photographs.
+
+## Colour and brightness from photographs
+
+Daylight photographs and high-speed film of fuel and munitions explosions agree on these values (sRGB, before the
+Lab's bloom). They are the palette of `VFX_Kaiju_Explosion`:
+
+| Role | RGB | Notes |
+|---|---|---|
+| contact core | 255, 244, 214 | pale yellow-white, **not** pure white; one short spike, gone by ~8 Lab frames |
+| fire body | 255, 168, 72 | orange; the body is the brightest part after the contact |
+| cooling edge | 214, 84, 28 | deep red-orange where the fire meets soot |
+| last glow | 120, 40, 18 → 60, 20, 10 | dull red pockets inside the smoke, then out |
+| soot | 38, 32, 29 | warm near black, opaque: the fire burns in front of it |
+| smoke column | 92, 84, 78 | brown-grey; lighter where the sun hits the top, darker underneath |
+| dust skirt | 150, 136, 118 | the ground's colour, lighter than the smoke |
+| steam | 205, 215, 225 | near white, thin, rises fast and disappears |
+
+- **Avoid pink and magenta in fire.** Saturated red-pink (high R and B) reads as a game effect immediately.
+- **The fire is not white for long.** In photographs the white-hot frame is one or two frames; after that the
+ brightest pixels are yellow-orange. Under the Lab's bloom a ramp that stays near white for 10 % of a long life
+ reads as a blown-out flash (an independent review flagged exactly that); start orange at about 5 %.
+- **Smoke outlives fire by a lot** and moves slowly: in a real blast the fireball is gone in about a second and the
+ column keeps climbing for many seconds. Keep its density (colour_end alpha above zero) and end the effect while it
+ is still visibly thinning, not after it has vanished.
+- **Smoke is lit from above.** Photographic smoke sheets have light tops and dark undersides; keep the roll small
+ (±12°) so the light stays on top, and emit with `spawn rotate=False` so `velocity` is world-up.
+- Emissive: additive fire 1.3–1.8 is enough; brighter values push the body past the bloom threshold and it turns
+ white. The value structure (pale core, orange body, dark soot) is what sells it, not raw intensity.
+
+## Textures
+
+Painted stylized puffs look like cartoons next to a photoreal world. The skill ships three photographic flipbooks
+(4×4, 1024², generated with an image model and processed; prompts in `assets/examples/texture_prompts.json`):
+
+| Texture | Use | Blend |
+|---|---|---|
+| `T_FireballSheet01` | the fireball: alpha = luminance, so hot pockets glow and soot is transparent | Add, with a `ramp` |
+| `T_FireballSootSheet01` | the same fireball's opaque body (shaded grey, full silhouette) | Blend, listed **before** the fire |
+| `T_SmokeSheet02` | photographic rolling smoke column with lit tops | Blend, tinted by the smoke colour |
+
+`smoke()` plays any `T_*Sheet*` texture as a 4×4 flipbook. For a column that must stay dense to the end, slow the
+flipbook (`flipbook=dict(x=4, y=4, frame_length=8, loop='Once')`) so it stops before the sheet's last, nearly empty
+cells.
+
+## Smoke and fire meeting the ground
+
+A sprite that cuts through the floor or a water surface leaves a hard horizontal line. Give ground smoke, dust and
+steam a `soft` distance (world units, a third to a half of the puff size) — verified in Forward+, see
+[engine conventions](engine-conventions.md#rendering-hdr-and-the-lab).
+
+## Layer plan of a photographic explosion
+
+Back to front: heat haze → smoke column (soft, slow flipbook) → soot body (Blend) → fireball (Add, photographic
+ramp) → fire lobes thrown off it → contact flash and a short bloom → ground pivot with a soft dust skirt rolling out →
+ground shock ring and refraction → spark tiers → dark debris that lands. `vfx examples show VFX_Kaiju_Explosion`
+prints the timeline.
diff --git a/skills/effekseer-vfx/references/scale.md b/skills/effekseer-vfx/references/scale.md
new file mode 100644
index 0000000..1e77923
--- /dev/null
+++ b/skills/effekseer-vfx/references/scale.md
@@ -0,0 +1,96 @@
+# World scale: giants, kaiju, warships
+
+Contents: why scale is more than size · declaring a scale · what converts · writing a scaled recipe · the Lab at
+scale · checks that scale with the recipe · using scaled effects in a game · how it was verified
+
+## Why scale is more than size
+
+Every primitive, default and craft number in this skill is tuned for a ~1.75 m character in a 1 unit = 1 m world:
+sparks fall at 0.0015 units/frame², a contact lasts 2–5 frames, the Lab anchors sit at 0.95 and 1.35 m. A monster
+70 m tall needs the same effects 40 times larger — and **slower**. A scaled-up explosion that keeps its
+character-scale timing reads as a miniature on a table: debris falls 40 m in a second, smoke boils like steam from a
+cup. Film model-makers shoot miniatures at high frame rates for the same reason (Froude similarity: time grows with
+the square root of size).
+
+Games and films do not go all the way: at sqrt(40) ≈ 6.3x a kaiju blast would last ten seconds and a breath weapon
+would feel sluggish. The profiles below stretch time by about world^0.25, so a 40x effect lasts 2.5x longer.
+
+## Declaring a scale
+
+Write the recipe at the Lab's character scale and add `scale` to `effect()`:
+
+```python
+return effect('Kaiju_Explosion', 'Kaiju Explosion', 'explosion', 'fire', 2.3, [...], scale='kaiju')
+```
+
+| `scale` | world | time | budget | for |
+|---|---|---|---|---|
+| `'character'` (default) | 1 | 1 | 1 | people, creatures up to ~3 m |
+| `'giant'` | 8 | 1.7 | 2 | 10–20 m giants, siege machines, mechs |
+| `'kaiju'` | 40 | 2.5 | 3 | 50–100 m monsters, warships, city-scale hits |
+| a number, e.g. `16` | 16 | 16^0.25 = 2.0 | 16^0.3 | your own size; time and budget follow the curve |
+| `{'world': 40, 'time': 1.5, 'budget': 2}` | as given | as given | as given | an exact profile (a game that wants faster kaiju) |
+
+`effect()` converts the recipe immediately and records the profile under `recipe['scale']`; the manifest carries
+it, so the Lab and `Vfx.gd` know the effect's size. Brief `beats` and every frame you read in a review are frames of
+the **built** (converted) timeline: a contact authored at frame 4 is at frame 10 in a kaiju strip.
+
+## What converts
+
+| Group | Fields | Conversion |
+|---|---|---|
+| time | `life`, `delay`, `interval`, `fade_in`, `fade_out`, `flipbook.frame_length`; effect `duration`, `peak`, `flight`, `hold` | × time (`life` and frame lengths round down to whole frames so nothing outlives the stretched duration) |
+| rates | `uv_scroll`, `alpha_scroll`, `distortion_scroll`, `blend_scroll`, `spin` | ÷ time |
+| node scale | `size`, `size_end`, `scale_start`, `scale_end` (a layer with none gets `scale_start=[world]*3`) | × world |
+| position | `position`, `travel.start/end`, `spawn.radius/start/end/noise`, force `position` | × world |
+| motion | `velocity`, turbulence/vortex `power` | × world ÷ time |
+| acceleration | `acceleration`, gravity forces | × world ÷ time² |
+| world coordinates | `collide.height`, `soft` | × world, on every level |
+| `bind` | numbers and the constant of `[k, '@In1']` | × world; equation strings (`'@In0'`) are world values the game supplies and stay |
+| effect | `arc` | × world |
+
+Only **top-level layers** are scaled in space: children live in their parent's coordinate frame, which is already
+scaled, so only their time and world-coordinate fields change. A child with `inherit={'scale': 'NotBind'}` lives in
+world units again and is scaled like a top-level layer. Ring and procedural-mesh geometry sits inside the node scale
+and needs nothing.
+
+## Writing a scaled recipe
+
+- Think and tune at character scale: the anchors, sizes and speeds you know from the other examples still apply.
+ Read the strips of the converted effect, not of a 1x version.
+- Kaiju effects are mostly **mass**: more smoke and dust volume, slower secondary motion, longer dissipation, fewer
+ but bigger pieces. The budget multiplier is for density, not for more noise.
+- Anything that must touch a surface (dust skirts, ground fire) needs world heights: write them relative to the Lab
+ anchors as usual (`floor = -1.3` under an `impact` anchor) and the conversion scales them.
+- Painted textures keep their resolution: a 1024² flipbook that covers 100 m of screen is soft. Prefer photographic
+ sheets with large forms (see [realism](realism.md)) and stack two or three puffs instead of one giant card.
+
+## The Lab at scale
+
+The Lab reads the selected effect's `scale.world` and scales the whole stage about the world origin: platform,
+floor, dummies (70 m capsules at kaiju scale), the camera position, near/far planes, shadow distance, the stage flash
+(light energy grows with distance, Godot omni lights fall off as 1/distance) and the camera kick. The framing is
+identical to a character-scale strip, so the review metrics — measured in stage heights — and the reviewer's eye
+compare across scales. The subtitle shows `KAIJU x40`.
+
+## Checks that scale with the recipe
+
+| Check | Scaled by |
+|---|---|
+| lint particle budget | × budget |
+| lint gravity limit (0.01 units/frame² at 1x) | × world ÷ time² |
+| lint contact flash length, contact-layer life, peak tolerance | × time |
+| review flash span, off-peak tolerance, dead-tail minimum | × time |
+
+## Using scaled effects in a game
+
+The `.efk` is built in world units: play it at scale 1 (`Vfx.play(id, position)`); do not scale the emitter again.
+The manifest's `scale` entry is informational for the game (and the Lab). A beam's `@In0` length is a world
+distance, so `Vfx.beam()` works the same at every scale.
+
+## How it was verified
+
+A copy of `VFX_Fire_Explosion` built with `scale={'world': 40, 'time': 1}` was rendered in the scaled Lab next to
+the original: the frames matched within a mean of 4–6/255 per pixel (random sparks and bloom differ), so the space
+conversion reproduces the effect exactly at 40x. The time stretch is a design choice, judged on the kaiju examples
+(`vfx examples add kaiju`) by independent review.
diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py b/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py
index 8fda8cc..4017271 100644
--- a/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py
+++ b/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py
@@ -1,6 +1,6 @@
"""Reusable, discovered-property layer authoring. No GUI state is required."""
from pathlib import Path
-import difflib, math
+import difflib, math, re
from .session import EffectSession
from .runtime import load_core
@@ -13,7 +13,7 @@ LAYER_FIELDS={
'travel','position','velocity','acceleration','rotation','spin','scale_start','scale_end','scale_curve','size','size_end','size_curve','easing',
'wrap','flipbook','alpha_texture','alpha_scroll','alpha_wrap','distortion_texture','distortion_scroll','distortion_intensity',
'blend_texture','blend_scroll','blend_type','cutoff','edge','falloff','soft','collide','spawn','forces','inherit',
- 'infinite','remove_with_parent','z_sort','priority','properties','curves','children'}
+ 'infinite','remove_with_parent','z_sort','priority','properties','curves','children','bind'}
NESTED_FIELDS={
'ring':{'vertices','outer','inner','center_ratio','outer_color','center_color','inner_color','angle_start','angle_end','angle_easing','angle_fade'},
'travel':{'start','end','easing'},
@@ -24,9 +24,20 @@ NESTED_FIELDS={
'inherit':{'location','rotation','scale','color'},
'collide':{'height','bounce','friction','reduction','world'},
'cutoff':{'start','end','easing'},
+ 'bind':{'position','scale'},
}
+# Dynamic equations: a game input (@In0..@In3), numbers, arithmetic and Effekseer's built-in functions only.
+EQUATION=re.compile(r'^[\s\w@.+\-*/(),]*$')
FORCE_FIELDS={'type','power','gravity','scale','octave','kind','control','min_range','max_range','position','rotation'}
+def _number(v):return isinstance(v,(int,float)) and not isinstance(v,bool)
+def _term(v):
+ """A bind component: a number, an equation string, or [number, equation] meaning their product."""
+ return _number(v) or isinstance(v,str) or (isinstance(v,(list,tuple)) and len(v)==2 and _number(v[0]) and isinstance(v[1],str))
+def _code(v):
+ if isinstance(v,(list,tuple)):return f'{float(v[0])!r} * ({v[1]})'
+ return repr(float(v)) if _number(v) else v
+
def _unknown(keys,allowed,where):
errors=[]
for key in keys:
@@ -52,6 +63,13 @@ def validate_layer(spec,where='',recursive=True):
for i,force in enumerate(spec.get('forces') or []):
if 'type' not in force:errors.append(f'{here}.forces[{i}]: force needs a type')
errors+=_unknown(force,FORCE_FIELDS,f'{here}.forces[{i}]')
+ bind=spec.get('bind')
+ if isinstance(bind,dict):
+ for key,value in bind.items():
+ if not isinstance(value,(list,tuple)) or len(value)!=3 or not all(_term(v) for v in value):
+ errors.append(f'{here}.bind.{key}: needs three components, each a number, an equation string such as "@In0" or [number, "equation"] (their product)')
+ elif not all(EQUATION.match(_code(v)) for v in value):
+ errors.append(f'{here}.bind.{key}: equations may only use @In0..@In3, numbers, arithmetic and functions')
if recursive:
for child in spec.get('children') or []:errors+=validate_layer(child,here)
return errors
@@ -91,6 +109,8 @@ class LayerBuilder:
self.session=session
self.schema=None
self.writes=[]
+ self.equations={} # equation code -> Core DynamicEquation, shared by every layer that binds the same code
+ self.bindings=[] # (vector property path, equation code) for the save/open check
def set(self,node,field,value):
if self.schema is None:
self.schema={p.removeprefix(node+'/') for p in self.session.property_list(node,12)}
@@ -130,6 +150,24 @@ class LayerBuilder:
self.scalar(n,root+'/UV','Scroll')
for axis,dim,speed in zip('XY',size,scroll):
self.rand(n,root+'/UVScroll/Size/'+axis,dim); self.rand(n,root+'/UVScroll/Speed/'+axis,speed*dim)
+ def bind(self,n,bind):
+ """Fixed position/scale that a dynamic equation recomputes every frame from the game's inputs (@In0..@In3):
+ a beam's length or its end point follows Vfx.beam() while the particles are alive."""
+ core=load_core()
+ for key,group,vector in (('position','LocationValues','Fixed/Location'),('scale','ScalingValues','Fixed/Scale')):
+ if key not in bind:continue
+ code='\n'.join(f'@O.{axis} = {_code(value)}' for axis,value in zip('xyz',bind[key]))
+ if code not in self.equations:
+ core.Dynamic.Equations.New()
+ equation=list(core.Dynamic.Equations.Values)[-1]
+ equation.Name.SetValue(f'bind {len(self.equations)}'); equation.Code.SetValue(code)
+ self.equations[code]=equation
+ self.scalar(n,group+'/Type','Fixed')
+ for axis,value in zip('XYZ',bind[key]):
+ self.scalar(n,f'{group}/{vector}/{axis}',float(value) if _number(value) else 0.)
+ self.scalar(n,f'{group}/{vector}/IsDynamicEquationEnabled',True)
+ self.session._object_at_path(f'{n}/{group}/{vector}').DynamicEquation.SetValue(self.equations[code])
+ self.bindings.append((f'{n}/{group}/{vector}',code))
def advanced(self,n,spec):
"""Optional native features: dissolve, UV distortion, blend texture, fresnel, flipbook, spawn shapes, forces."""
s=self.scalar; r=self.rand; A='AdvancedRendererCommonValuesValues/'
@@ -334,6 +372,7 @@ class LayerBuilder:
s(n,'ScalingValues/Type','Easing')
v(n,'ScalingValues/Easing/Start',start,True); v(n,'ScalingValues/Easing/End',end,True)
s(n,'ScalingValues/Easing/Type',spec.get('easing','EaseOutCubic'))
+ if spec.get('bind'):self.bind(n,spec['bind'])
for field,value in spec.get('properties',{}).items(): self.set(n,field,value)
for field,keys in spec.get('curves',{}).items(): self.curve(n,field,keys)
for child in spec.get('children',[]):self.layer(child,n)
@@ -353,6 +392,11 @@ def compile_effect(recipe,source_path,runtime_path=None):
for layer in recipe['layers']:builder.layer(layer)
core=load_core(); core.EndFrame=int(recipe.get('duration',1)*60); core.IsLoop=bool(recipe.get('loop',False))
core.Global.RandomSeed.SetValue(int(recipe.get('seed',1729)))
+ # Default values of the game inputs (@In0..@In3) that bind equations read: what the Effekseer editor previews with and
+ # what a new Godot handle starts from until Vfx.gd pushes the game's values.
+ inputs=[float(v) for v in recipe.get('inputs') or []]
+ if len(inputs)>4:raise ValueError('Effekseer has four game inputs (@In0..@In3)')
+ for slot,value in enumerate(inputs):list(core.Dynamic.Inputs.Values)[slot].Input.SetValue(value)
session.save()
# Round-trip through the official reader before runtime export.
session=EffectSession.open(source)
@@ -362,5 +406,10 @@ def compile_effect(recipe,source_path,runtime_path=None):
actual=session.property_get(path)
equal=math.isclose(actual,value,rel_tol=1e-5,abs_tol=1e-6) if isinstance(value,(int,float)) and not isinstance(value,bool) else actual==value
if not equal:raise RuntimeError(f'Property did not survive Core save/open: {path}: {value!r} -> {actual!r}')
+ for path,code in builder.bindings:
+ equation=session._object_at_path(path).DynamicEquation.Value
+ if equation is None or equation.Code.Value!=code:raise RuntimeError(f'Dynamic equation did not survive Core save/open: {path}')
+ saved=[float(i.Input.Value) for i in load_core().Dynamic.Inputs.Values][:len(inputs)]
+ if not all(math.isclose(a,b,rel_tol=1e-5,abs_tol=1e-6) for a,b in zip(saved,inputs)):raise RuntimeError(f'Game input defaults did not survive Core save/open: {inputs} -> {saved}')
if runtime_path:session.export(runtime_path)
return {'source':str(source),'runtime':str(runtime_path) if runtime_path else None,'nodes':session.node_list(),'writes':len(builder.writes)}
diff --git a/skills/effekseer-vfx/scripts/vfxkit/__init__.py b/skills/effekseer-vfx/scripts/vfxkit/__init__.py
index ff2ad07..b765a12 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/__init__.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/__init__.py
@@ -1,2 +1,2 @@
"""effekseer-vfx toolchain: recipe primitives, lint, Core build, Godot review and evidence for one game project."""
-__version__ = '0.1.0'
+__version__ = '0.2.0'
diff --git a/skills/effekseer-vfx/scripts/vfxkit/briefs.py b/skills/effekseer-vfx/scripts/vfxkit/briefs.py
index 1589c28..00480c8 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/briefs.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/briefs.py
@@ -83,7 +83,7 @@ def validate(brief, recipe):
previous = frame
if not isinstance(beat, dict) or not beat.get('name') or not beat.get('expect'):
errors.append('each beat needs name and expect')
- rows = timeline(recipe['layers'], release=recipe.get('flight', 0)*60)
+ rows = timeline(recipe['layers'], release=(recipe.get('flight') or recipe.get('hold') or 0)*60)
duplicates = [n for n, c in Counter(r['path'] for r in rows).items() if c > 1]
if duplicates:
errors.append(f'Layer paths must be unique for brief association: {duplicates}')
diff --git a/skills/effekseer-vfx/scripts/vfxkit/discover.py b/skills/effekseer-vfx/scripts/vfxkit/discover.py
index 2b45cc2..c7aa60d 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/discover.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/discover.py
@@ -5,8 +5,8 @@ from .paths import WORK
def discover():
from effekseer_ai.session import EffectSession
- from System import Enum
s = EffectSession.new()
+ from System import Enum # .NET namespaces import only after EffectSession has loaded Core
p = 'node/root/0'
result = {}
for x in s.property_list(p, 12):
diff --git a/skills/effekseer-vfx/scripts/vfxkit/examples.py b/skills/effekseer-vfx/scripts/vfxkit/examples.py
index ca192b7..4e32af2 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/examples.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/examples.py
@@ -1,4 +1,5 @@
-"""Shipped example effects: four ranged pairs (projectile + impact) and five single effects, with briefs and painted textures.
+"""Shipped example effects: four ranged pairs (projectile + impact), five single effects and the kaiju set (world scale,
+beam, charge chain, photographic explosion), with briefs and painted textures.
`add` copies an example into the project like any hand-written effect. Its historical review describes the
source renders, not your build: build and review it again before relying on it.
@@ -21,15 +22,20 @@ def ids(name):
data = catalog()
pairs = {p['name']: p for p in data['pairs']}
singles = {s['name']: s for s in data.get('singles', [])}
+ sets = {s['name']: s for s in data.get('sets', [])}
if name == 'all':
- return [i for p in pairs.values() for i in (p['projectile'], p['impact'])] + [s['effect'] for s in singles.values()]
+ return ([i for p in pairs.values() for i in (p['projectile'], p['impact'])] + [s['effect'] for s in singles.values()]
+ + [i for s in sets.values() for i in s['effects']])
if name in pairs:
return [pairs[name]['projectile'], pairs[name]['impact']]
if name in singles:
return [singles[name]['effect']]
+ if name in sets:
+ return list(sets[name]['effects'])
if (EXAMPLES / f'src/{name}.py').is_file():
return [name]
- raise ValueError(f'Unknown example {name!r}; choose all, a pair ({", ".join(pairs)}), a single ({", ".join(singles)}) or an effect ID')
+ raise ValueError(f'Unknown example {name!r}; choose all, a pair ({", ".join(pairs)}), a single ({", ".join(singles)}), '
+ f'a set ({", ".join(sets)}) or an effect ID')
def textures(rid):
@@ -41,7 +47,7 @@ def textures(rid):
def listing():
data = catalog()
- return {'ok': True, 'note': data['note'], 'pairs': data['pairs'], 'singles': data.get('singles', []),
+ return {'ok': True, 'note': data['note'], 'pairs': data['pairs'], 'singles': data.get('singles', []), 'sets': data.get('sets', []),
'historical_scores': data['historical_scores'], 'historical_review': data.get('historical_review'),
'usage': 'vfx examples show <name|ID>; vfx examples add <name|ID|all>; then vfx lint, vfx build, vfx review'}
@@ -91,7 +97,7 @@ def show(rid):
brief = json.loads((EXAMPLES / f'briefs/{rid}.json').read_text())
roles = {item['name']: item['role'] for item in brief.get('layer_plan', [])}
plan = []
- for row, layer in zip(timeline(recipe['layers'], release=recipe.get('flight', 0) * 60), walk(recipe['layers'])):
+ for row, layer in zip(timeline(recipe['layers'], release=(recipe.get('flight') or recipe.get('hold') or 0) * 60), walk(recipe['layers'])):
plan.append({**row, 'role': roles.get(row['path'], 'supporting detail'), 'renderer': layer.get('renderer', 'Sprite'),
'texture': Path(layer['texture']).stem if layer.get('texture') else None})
result = {'ok': True, 'id': rid, 'design': recipe.get('design'), 'delivery': recipe.get('delivery'),
diff --git a/skills/effekseer-vfx/scripts/vfxkit/lint.py b/skills/effekseer-vfx/scripts/vfxkit/lint.py
index 2ea9f4c..d9ddb60 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/lint.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/lint.py
@@ -4,10 +4,11 @@ Errors are hard rules that make a build wrong (unknown fields, budget, lifetime,
textures); `build` refuses to run while any exist. Warnings encode the references/craft.md heuristics:
they point at likely craft problems but the rendered strip decides.
"""
-import json
+import json, re
from pathlib import Path
from effekseer_ai.authoring import validate_layer
-from .primitives import walk, lifetime, budget, TEXTURE_KEYS
+from .primitives import walk, lifetime, budget, life_max, TEXTURE_KEYS
+from .scale import factors
from .paths import ROOT
BUDGET={'hit':60,'boss':250,'projectile':100} # references/craft.md, budgets; every other category is an element skill
@@ -20,6 +21,11 @@ HOT_LUMA=.85 # same bar as review.py, so lint and review agree
PEAK_TOLERANCE=6 # frames between the contact flash and manifest peak, where the Lab kicks
MIN_DIFFERENCES=3 # of shape, motion, rhythm, material, secondary (section 3)
+def release_frames(recipe):
+ """Frames after the start at which the reference performance releases sustained layers: a projectile's flight or a
+ beam's hold; 0 when the recipe has neither."""
+ return (recipe.get('flight') or recipe.get('hold') or 0)*60
+
def documented_textures():
from .textures import masks,EXTRA_PROCEDURAL
path=ROOT/'vfx/texture_prompts.json'
@@ -80,17 +86,19 @@ def lint(recipe,known=None):
errors=[];warnings=[]
procedural,painted=known or documented_textures()
layers=list(walk(recipe['layers'])); rid=recipe['id']; frames=recipe['duration']*60
+ # A scaled recipe (references/scale.md) is checked against the same craft rules in its own world and time.
+ world,stretch,more=factors(recipe)
for layer in recipe['layers']:errors+=validate_layer(layer)
if not 0<=recipe.get('peak',0)<recipe['duration']:errors.append(f"peak {recipe.get('peak')} s is outside the {recipe['duration']} s duration")
- release=recipe.get('flight',0)*60
+ release=release_frames(recipe)
sustained=[l for l in layers if l.get('infinite')]
- if sustained and not recipe.get('flight'):errors.append(f"{sustained[0]['name']}: infinite layers emit until release, so the recipe needs flight (seconds of the reference flight)")
+ if sustained and not release:errors.append(f"{sustained[0]['name']}: infinite layers emit until release, so the recipe needs flight (seconds of the reference flight) or hold (seconds a beam fires)")
for layer in sustained:
if not layer.get('interval'):errors.append(f"{layer['name']}: infinite layer needs an interval > 0 or it spawns without limit")
if not recipe.get('loop'):
for layer in recipe['layers']:
if lifetime(layer,release=release)>frames:errors.append(f"{layer['name']}: alive until frame {round(lifetime(layer,release=release))} but the effect ends at {round(frames)}; it would be cut off on recycle")
- limit=BUDGET.get(recipe.get('category'),DEFAULT_BUDGET); total=sum(budget(l) for l in recipe['layers'])
+ limit=round(BUDGET.get(recipe.get('category'),DEFAULT_BUDGET)*more); total=sum(budget(l) for l in recipe['layers'])
if total>limit:errors.append(f"particle budget {total} exceeds {limit} for category {recipe.get('category')!r}")
for layer in layers:
for key in TEXTURE_KEYS:
@@ -106,32 +114,55 @@ def lint(recipe,known=None):
if layer.get('flipbook') and layer.get('distortion_texture'):
errors.append(f"{layer['name']}: UV distortion on a flipbook samples neighbouring cells (hard square edges); drop distortion_texture or use a single-frame texture")
for force in layer.get('forces') or []:
- if force.get('type')=='Gravity' and max(abs(g) for g in force.get('gravity',[0,0,0]))>MAX_GRAVITY:
- errors.append(f"{layer['name']}: gravity {force['gravity']} is per frame squared; above {MAX_GRAVITY} particles leave the screen")
+ if force.get('type')=='Gravity' and max(abs(g) for g in force.get('gravity',[0,0,0]))>MAX_GRAVITY*world/stretch**2:
+ errors.append(f"{layer['name']}: gravity {force['gravity']} is per frame squared; above {MAX_GRAVITY*world/stretch**2:.4g} particles leave the screen")
+ # Soft particles (verified in Forward+, references/engine-conventions.md): a fade distance in world units against
+ # the opaque depth buffer.
+ if 'soft' in layer:
+ soft=layer['soft']
+ if isinstance(soft,bool) or not isinstance(soft,(int,float)) or soft<=0:errors.append(f"{layer['name']}: soft is the fade distance in world units and must be a positive number")
+ else:
+ size=layer.get('size'); extent=max(size) if isinstance(size,(list,tuple)) else size
+ # soft is in world units; a child's size is in its parent's frame, which a scaled recipe has grown by `world`.
+ if isinstance(extent,(int,float)) and not any(layer is top for top in recipe['layers']):extent*=world
+ if isinstance(extent,(int,float)) and soft>extent*.75:
+ warnings.append(f"{layer['name']}: soft {soft:g} is close to the particle size {extent:g}; the whole card fades wherever geometry is behind it, not only the intersection")
+ bind=layer.get('bind') or {}
+ if 'scale' in bind and any(k in layer for k in ('size','size_end','size_curve','scale_start','scale_end','scale_curve')):
+ errors.append(f"{layer['name']}: bind.scale replaces the layer's scale every frame; drop size/scale fields or put the bound part on its own layer")
+ if 'position' in bind and any(k in layer for k in ('travel','velocity','acceleration')):
+ errors.append(f"{layer['name']}: bind.position fixes the position every frame; travel/velocity/acceleration would be ignored")
+ used={int(slot) for value in bind.values() for v in value for slot in re.findall(r'@In(\d)',str(v))}
+ if any(slot>3 for slot in used):errors.append(f"{layer['name']}: Effekseer has four game inputs, @In0..@In3")
+ elif used and len(recipe.get('inputs') or [])<=max(used):errors.append(f"{layer['name']}: bind reads @In{max(used)}; give the recipe inputs=[...] defaults for every input it reads")
life=layer.get('life',24); shortest=min(life) if isinstance(life,(list,tuple)) else life
if layer.get('fade_in',1)+layer.get('fade_out',0)>shortest*1.05:warnings.append(f"{layer['name']}: fade_in+fade_out exceed the shortest life {shortest}; it never reaches full opacity")
# Craft heuristics (warnings).
- flashes=[l for l in layers if stem(l.get('texture'))==CONTACT_TEXTURE]
+ # Sustained layers (a beam's mouth flare) burn for as long as the game holds them; they are not the contact.
+ flashes=[l for l in layers if stem(l.get('texture'))==CONTACT_TEXTURE and not l.get('infinite')]
def longest(l):life=l.get('life',24);return max(life) if isinstance(life,(list,tuple)) else life
- contacts=flashes+[l for l in layers if l not in flashes and l.get('count',1)==1 and l.get('blend','Add')=='Add' and longest(l)<=CONTACT_LAYER_LIFE and any(hot(c) for c in colours(l))]
+ contacts=flashes+[l for l in layers if l not in flashes and l.get('count',1)==1 and l.get('blend','Add')=='Add' and longest(l)<=CONTACT_LAYER_LIFE*stretch and any(hot(c) for c in colours(l))]
if recipe.get('impact',0)>=.3:
if not contacts:warnings.append('impact effect without a contact flash: no flash() layer and no short single white-hot additive layer; the Lab kick at peak has no matching bright frame')
else:
peak=recipe.get('peak',0)*60; nearest=min(contacts,key=lambda l:abs(l.get('delay',0)-peak))
- if abs(nearest.get('delay',0)-peak)>PEAK_TOLERANCE:warnings.append(f"contact {nearest['name']!r} starts at frame {nearest.get('delay',0)} but manifest peak is frame {peak:.0f}; the Lab flash and camera kick land elsewhere")
+ if abs(nearest.get('delay',0)-peak)>PEAK_TOLERANCE*stretch:warnings.append(f"contact {nearest['name']!r} starts at frame {nearest.get('delay',0)} but manifest peak is frame {peak:.0f}; the Lab flash and camera kick land elsewhere")
for l in flashes:
life=l.get('life',5)
- if (max(life) if isinstance(life,(list,tuple)) else life)>CONTACT_MAX_LIFE:warnings.append(f"{l['name']}: contact flash lives {life} frames; contact should be 2-5")
+ if (max(life) if isinstance(life,(list,tuple)) else life)>CONTACT_MAX_LIFE*stretch:warnings.append(f"{l['name']}: contact flash lives {life} frames; contact should be 2-5")
# Lightning changes shape by swapping frames: the same painted shape on several layers that start at different times.
starts={}
for l in layers:
if l.get('count',1)==1 and stem(l.get('texture')):starts.setdefault(stem(l['texture']),set()).add(l.get('delay',0))
+ # A short-lived painted shape emitted again and again (charge_chain's arcs) is re-struck as well.
+ elif stem(l.get('texture')) and l.get('interval',0)>0 and (l.get('count',1)>1 or l.get('infinite')) and life_max(l)<=2*l['interval']:
+ starts.setdefault(stem(l['texture']),set()).update({l.get('delay',0),l.get('delay',0)+l['interval']})
swapped=any(len(s)>=2 for name,s in starts.items() if name in painted)
if not swapped and not any(l.get('cutoff') is not None or l.get('distortion_texture') or l.get('uv_scroll') or l.get('alpha_scroll') or l.get('flipbook') or (isinstance(l.get('ring'),dict) and 'angle_end' in l['ring']) for l in layers):
warnings.append('no layer changes shape (dissolve cutoff, ring sweep, UV distortion/scroll, flipbook or a painted shape re-struck on later frames); the body can only scale and fade')
if not any(hot(c) for l in layers if l.get('blend','Add')=='Add' for c in colours(l)):
warnings.append(f'no white-hot additive colour (luma >= {HOT_LUMA}, min channel >= 180); brightness layering needs a hot core above the saturated body')
- timeline=sorted(([l['name'],l.get('delay',0),round(lifetime(l,release=recipe.get("flight",0)*60))] for l in recipe['layers']),key=lambda t:t[1])
+ timeline=sorted(([l['name'],l.get('delay',0),round(lifetime(l,release=release))] for l in recipe['layers']),key=lambda t:t[1])
return {'id':rid,'errors':errors,'warnings':warnings,'budget':[total,limit],'timeline':timeline}
def compare_elements(recipes):
diff --git a/skills/effekseer-vfx/scripts/vfxkit/primitives.py b/skills/effekseer-vfx/scripts/vfxkit/primitives.py
index c127904..fd85c26 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/primitives.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/primitives.py
@@ -138,7 +138,7 @@ def orbit_band(name,color,inner_color,outer_color,radius,width,life,tilt=(-72,0,
def smoke(name,color,count=5,size=(.5,.9),grow=1.9,life=(30,48),delay=0,interval=0,speed=(.005,.02),rise=.0004,radius=(0,.25),texture='T_SmokeSheet01',**kw):
"""Alpha-blended puffs that grow and slow down. The default painted flipbook billows, curls and tears itself
apart over life (a single still puff only scales), so the noise dissolve is light; still textures erode harder."""
- sheet=texture.endswith('Sheet01')
+ sheet='Sheet' in texture # every T_*Sheet* texture is a 4x4 flipbook; drawn whole it would show 16 puffs
extra=dict(flipbook=dict(x=4,y=4,frame_length=max(1,round(max(life)/16)),loop='Once'),cutoff=dict(start=0,end=.3,easing='EaseInCubic')) if sheet else dict(cutoff=dict(start=0,end=.7,easing='EaseInQuadratic'))
return sprite(name,texture,color,color_end=fade(color),count=count,life=list(life),delay=delay,interval=interval,blend='Blend',billboard='RotatedBillboard',
spawn=dict(shape='Sphere',radius=list(radius)),velocity=[0,list(speed),0],rotation=[0,0,[-180,180]],spin=[0,0,[-.6,.6]],
@@ -245,18 +245,26 @@ def column(name,color,radius,height,life,delay=0,scroll=(.003,-.02),**kw):
return mesh(name,'Cylinder',color,life,radius=radius,depth=height,texture='T_NoiseStreak02',uv_scroll=list(scroll),delay=delay,culling='Double',
alpha_texture='T_GradientV01',alpha_wrap='Clamp',falloff=dict(begin=[255,255,255,255],end=[255,255,255,0],pow=1.6,blend='Mul')) | kw
-def effect(id,name,category,element,duration,layers,attach='impact',peak=.1,impact=0,light=(1,.85,.6),loop=False,design='',delivery=None,flight=None,arc=None):
+def effect(id,name,category,element,duration,layers,attach='impact',peak=.1,impact=0,light=(1,.85,.6),loop=False,design='',delivery=None,flight=None,arc=None,
+ hold=None,inputs=None,scale=None):
"""impact (0..1) and light drive the lab's flash and camera kick at peak; they are stage hints, not Effekseer data.
delivery tells a game (and the Lab) how the effect is performed: {'kind':'self'} on the caster, 'melee' on the
target at the strike, 'projectile' (with the projectile effect id) on the target when the shot arrives,
- 'targeted' called down on the target, 'area' centred on a caster that hits everything around it.
+ 'targeted' called down on the target, 'area' centred on a caster that hits everything around it, 'beam' fired
+ from the caster's mouth or weapon at a point the game keeps updating (see beam()).
Projectiles declare flight (seconds of the reference flight) and optional arc (metres of lift at mid-flight);
- their `infinite` layers emit until the game releases them on arrival.
+ beams declare hold (seconds the reference beam fires). Their `infinite` layers emit until the game releases them.
+ inputs are the default values of the game inputs @In0..@In3 that `bind` equations read (a beam's length and power).
+ scale converts a recipe written at the Lab's character scale to a larger world: 'giant', 'kaiju', a number or
+ {'world','time','budget'} (see vfxkit.scale and references/scale.md).
"""
entry=dict(id='VFX_'+id,name=name,category=category,element=element,duration=duration,loop=loop,attach=attach,peak=peak,impact=impact,light=list(light),seed=1729,layers=layers,design=design)
- for key,value in [('delivery',delivery),('flight',flight),('arc',arc)]:
+ for key,value in [('delivery',delivery),('flight',flight),('arc',arc),('hold',hold),('inputs',list(inputs) if inputs is not None else None)]:
if value is not None:entry[key]=value
+ if scale is not None and scale!='character':
+ from .scale import apply
+ entry=apply(entry,scale)
return entry
def life_max(layer):
@@ -285,7 +293,7 @@ POP=[[0,.4],[18,1],[100,1.1]] # snap to size, then drift
# nearly whole for the first third, then eats it away.
DISSOLVE=dict(start=0,end=.9,easing='EaseInQuadratic')
# How a game performs each effect (manifest `delivery`); the Lab stages the exchange from it.
-SELF=dict(kind='self'); MELEE=dict(kind='melee'); TARGETED=dict(kind='targeted')
+SELF=dict(kind='self'); MELEE=dict(kind='melee'); TARGETED=dict(kind='targeted'); BEAM=dict(kind='beam')
# Trail layers keep the world position they were born at, so a moving projectile leaves them behind.
TRAIL=dict(location='WhenCreating',rotation='WhenCreating',scale='WhenCreating')
@@ -369,4 +377,111 @@ def contrast_pair(layer, dark_color=(32, 24, 20, 210)):
dark['color_curve']['A']=[[frame,value*dark_color[3]/255] for frame,value in alpha]
return [dark, bright]
+# ---------------------------------------------------------------- beams and charges
+
+# Game inputs a beam reads (Vfx.beam() keeps them current): @In0 is the length to the end point in world units,
+# @In1 the power 0..1 that widens the beam as it ignites and narrows it as it dies.
+BEAM_LENGTH='@In0'; BEAM_POWER='@In1'
+
+def beam_inputs(length,power=1.0):
+ """Default inputs of a beam recipe (effect(..., inputs=beam_inputs(8))): what the editor and the Lab show
+ before a game sets them."""
+ return [length,power,0,0]
+
+def held(layer,interval):
+ """Sustained cross-fade: a new instance every `interval` frames, each fading in and out over `interval`, so two
+ always overlap and their (linear) fades sum to a constant: a steady body with no pop and no loop seam. The game's
+ release stops emission and the last instances fade out within 2 x interval frames."""
+ return layer|dict(infinite=True,count=1,interval=interval,life=2*interval,fade_in=interval,fade_out=interval)
+
+def _beam_strip(name,texture,color,width,interval,**kw):
+ # Axial billboard along local +Y: the quad turns about the beam axis to face the camera; bind stretches it to the
+ # end point every frame and scales its width with power.
+ return held(sprite(name,texture,color,billboard='YAxisFixed',pivot='bottom',bind={'scale':[[width,BEAM_POWER],BEAM_LENGTH,1]},**kw),interval)
+
+def beam(name,core,body,rim,width=.5,interval=6,flow=.05,origin=1.4,end=1.8,sparks=6,haze=.6,steam=None,steam_life=(50,70),scorch=None,scorch_life=40):
+ """Sustained energy beam along local +Y from the effect's origin to a point @In0 away (Vfx.beam() aims the
+ handle and updates the length every frame, so the game can sweep it). Built from the outside in:
+
+ - haze: screen refraction around the beam (haze=0 drops it);
+ - rim: wide coloured glow, body: saturated beam with noise streaks flowing outward, core: thin white-hot line.
+ Every strip uses the T_BeamSection01 cross-section, so the beam keeps full strength to its very end;
+ - origin and end flashes: glow + flare at the mouth and at the hit point, scaled by power;
+ - end sparks (and optional steam, an RGBA colour) thrown back from the hit point every `interval` frames, and an
+ optional scorch (RGBA): glowing marks that stay where the beam touched and cool from that colour through orange to
+ dark red over `scorch_life` frames. They
+ inherit the hit point only at birth, so a sweeping beam leaves a trail of them behind and they carry the effect's
+ tail after the release (an independent review flagged an empty stage once the beam shut off).
+
+ Pair it with effect(..., delivery=BEAM, hold=<seconds the Lab fires>, inputs=beam_inputs(<length>)) and a one-shot
+ ignition (flash at frame 0-1) for the contact. Widths are Lab metres; scale='kaiju' converts them."""
+ def point(label,texture,color,size,at,**kw):
+ return held(sprite(label,texture,color,billboard='Billboard' if texture!='T_Flare01' else 'RotatedBillboard',
+ bind={'position':[0,at,0],'scale':[[size,BEAM_POWER],[size,BEAM_POWER],1]},**kw),interval)
+ layers=[]
+ if haze:layers.append(_beam_strip(name+' haze','T_DistortHaze01',WHITE,width*3,interval,material='BackDistortion',distortion=haze,uv_scroll=[0,-.01]))
+ layers+=[
+ # Emissive steps keep the value layering of a hit: only the core burns past the bloom threshold; the body stays
+ # saturated and the rim is a dim halo. With body/rim at 1.2+ the overlapping additive strips tonemap to white and
+ # the beam loses its colour under the Lab's bloom (measured on the kaiju atomic beam).
+ _beam_strip(name+' rim','T_BeamSection01',rim,width*2.6,interval,alpha_texture='T_NoiseStreak02',alpha_scroll=[0,-flow*.6],emissive=.7),
+ # The body keeps most of its opacity (blend_texture modulates, not erodes): a noise alpha at full strength halves
+ # it and the colour disappears between the white core and the background.
+ _beam_strip(name+' body','T_BeamSection01',body,width,interval,blend_texture='T_NoiseStreak02',blend_scroll=[0,-flow],blend_type='Add',emissive=1.1),
+ _beam_strip(name+' core','T_BeamSection01',core,width*.18,interval,emissive=1.8),
+ point(name+' origin glow','T_Glow01',body,origin,0,emissive=1.0),
+ point(name+' origin flare','T_Flare01',core,origin*.8,0,emissive=1.8),
+ point(name+' end glow','T_Glow01',body,end,BEAM_LENGTH,emissive=1.0),
+ point(name+' end flare','T_Flare01',core,end*.7,BEAM_LENGTH,emissive=2.0),
+ ]
+ children=[]
+ if sparks:children.append(radial_sparks(name+' end sparks',sparks,core,color_end=body,distance=(end*.5,end*1.3),life=(10,16),delay=0,gravity=.0015,
+ inherit=TRAIL,hemisphere=False))
+ # The steam's flipbook plays slower than its life, so it never reaches the sheet's nearly empty last cells: it is
+ # still a visible, thinning plume when its life ends (a review found the stage empty while the steam was "alive").
+ if steam:children.append(smoke(name+' end steam',steam,count=1,size=(end*.5,end*.7),grow=2.4,life=steam_life,speed=(.01,.02),rise=.0006,inherit=TRAIL,
+ soft=end*.2,color_end=fade(steam,steam[3]//2),flipbook=dict(x=4,y=4,frame_length=max(1,round(max(steam_life)/12)),loop='Once')))
+ if scorch:children.append(sprite(name+' scorch','T_Glow01',**ramp((0,scorch),(30,(255,150,70,scorch[3])),(70,(150,50,20,scorch[3]*2//3)),(100,(60,20,10,0))),
+ life=scorch_life,size=end*.8,size_curve=[[0,1],[100,.75]],billboard='Billboard',inherit=TRAIL,fade_in=0,fade_out=scorch_life*.5,emissive=1.3))
+ if children:
+ # The emitter of the spray: an invisible point riding the end of the beam.
+ layers.append(dict(name=name+' hit point',renderer='None',infinite=True,count=1,interval=interval,life=2*interval,
+ bind={'position':[0,BEAM_LENGTH,0]},children=children))
+ return layers
+
+def _aim(start,end):
+ """Velocity that points a DirectionalBillboard sprite from start toward end without visibly moving it."""
+ d=[b-a for a,b in zip(start,end)]; n=math.sqrt(sum(c*c for c in d)) or 1
+ return [c/n*1e-4 for c in d],n
+
+def charge_chain(name,anchors,color,hot,step=4,until=None,width=.35,glow=.6,texture='T_ArcStrand01',restrike=3,delay=0):
+ """Electric arcs that light up along a chain of anchor points one after another (dorsal plates charging from the
+ tail to the head, capacitor coils, a ley line): node i ignites at delay + i*step frames with a glow, then an arc
+ jumps to node i+1 and keeps re-striking until `until` (default: a beat after the last node lights).
+
+ anchors are local positions (Lab metres before scale). Each arc is a painted strand on an axial billboard aimed
+ along its segment (DirectionalBillboard with an imperceptible velocity), re-struck every `restrike` frames
+ alternately mirrored, so the bolt keeps changing shape instead of sliding. A charge is a self effect: the game plays
+ it on the caster before the beam."""
+ if len(anchors)<2:raise ValueError('charge_chain needs at least two anchors')
+ last=delay+(len(anchors)-1)*step; until=until if until is not None else last+18
+ layers=[]
+ for i,at in enumerate(anchors):
+ born=delay+i*step; span=max(4,until-born)
+ layers.append(sprite(f'{name} node {i+1}','T_Glow01',color,delay=born,life=span,size=glow,size_curve=[[0,1.8],[12,1],[100,1.1]],
+ billboard='Billboard',position=list(at),fade_in=0,fade_out=min(6,span*.3),emissive=2.0))
+ # A small coloured pop, not a star flare (a T_Flare01 star on the first plate read as generic magic before any arc
+ # showed) and not white: the release at the end of the chain must stay the brightest frame.
+ layers.append(sprite(f'{name} node {i+1} spark','T_Glow01',color,delay=born,life=5,size=glow*1.1,size_curve=[[0,1.4],[100,.4]],billboard='Billboard',
+ position=list(at),fade_in=0,fade_out=4,emissive=1.4))
+ if i+1==len(anchors):continue
+ # The arc jumps on the frame its plate lights, so the very first frames already read as electricity climbing.
+ velocity,length=_aim(at,anchors[i+1]); start=born; strikes=max(1,(until-start)//restrike)
+ for side,mirror in ((0,1),(1,-1)):
+ if strikes-side<1:continue
+ layers.append(sprite(f'{name} arc {i+1}{"ab"[side]}',texture,hot,color_end=color,count=(strikes-side+1)//2,interval=restrike*2,
+ delay=start+side*restrike,life=restrike+1,billboard='DirectionalBillboard',pivot='bottom',position=list(at),velocity=velocity,
+ scale_start=[width*mirror,length,1],fade_in=0,fade_out=1,emissive=2.6))
+ return layers
+
__all__=[name for name in dir() if not name.startswith('_') and name not in ('Path','math','ROOT','T','is_path')]+['math']
diff --git a/skills/effekseer-vfx/scripts/vfxkit/review.py b/skills/effekseer-vfx/scripts/vfxkit/review.py
index 2a32593..b465540 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/review.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/review.py
@@ -238,14 +238,17 @@ def metrics(rid,frames,entry,step=4):
if first and len(before_contact)>=3 and contact['frame']-first['frame']>=12:
motion['charge_spread']=round(before_contact[-1]['radius']/max(before_contact[0]['radius'],1e-3),2)
flags=[]
+ # Scaled effects (references/scale.md) last `stretch` times longer: frame tolerances stretch with them.
+ stretch=float((entry.get('scale') or {}).get('time',1)); beam=(entry.get('delivery') or {}).get('kind')=='beam'
if widest['coverage']<VISIBLE_COVERAGE:flags.append(f'barely visible: under {VISIBLE_COVERAGE:.2%} of the stage changes at its strongest frame')
- if total-last_active>max(6,total*DEAD_TAIL):flags.append(f'dead tail: under {ACTIVE_FRACTION:.0%} of peak energy and {VISIBLE_COVERAGE:.2%} of the stage after frame {last_active} of {round(total)}; shorten duration or keep the dissipation visible')
+ if total-last_active>max(6*stretch,total*DEAD_TAIL):flags.append(f'dead tail: under {ACTIVE_FRACTION:.0%} of peak energy and {VISIBLE_COVERAGE:.2%} of the stage after frame {last_active} of {round(total)}; shorten duration or keep the dissipation visible')
if sum(t['white']>.1 for t in timeline)>2:flags.append('blown out: over 10% pure white for more than two sampled frames')
if not entry.get('loop') and visible and timeline[-1]['coverage']>CUT_OFF_COVERAGE:flags.append('cut off: still clearly visible on the last frame')
if entry.get('impact',0)>=.3:
expected=entry.get('peak',0)*60
- if abs(contact['frame']-expected)>max(6,2*step):flags.append(f"off-peak contact: brightest at frame {contact['frame']} but manifest peak is frame {expected:.0f}; the Lab flash and camera kick land elsewhere")
- if flash_span>FLASH_SPAN:flags.append(f'lingering flash: near-peak white lasts {flash_span} frames; contact should be 2-5')
+ # A beam's sustained white core outshines its ignition, so the contact of a beam is not its whitest frame.
+ if not beam and abs(contact['frame']-expected)>max(6,2*step)*stretch:flags.append(f"off-peak contact: brightest at frame {contact['frame']} but manifest peak is frame {expected:.0f}; the Lab flash and camera kick land elsewhere")
+ if flash_span>FLASH_SPAN*stretch:flags.append(f'lingering flash: near-peak white lasts {flash_span} frames; contact should be 2-5')
layering=peak.get('layers')
if layering and widest['coverage']>=VISIBLE_COVERAGE:
if layering[0]<.005:flags.append('no white-hot core: almost no pixel above 85% brightness at the peak frame')
diff --git a/skills/effekseer-vfx/scripts/vfxkit/scale.py b/skills/effekseer-vfx/scripts/vfxkit/scale.py
new file mode 100644
index 0000000..e3cceb7
--- /dev/null
+++ b/skills/effekseer-vfx/scripts/vfxkit/scale.py
@@ -0,0 +1,168 @@
+"""World scale: write a recipe at the Lab's character scale and build it for a much larger world (giants, kaiju).
+
+Primitives, defaults and craft numbers are tuned for a ~1.75 m character in a 1-unit = 1 m world. A recipe that
+declares `scale` keeps those numbers and is converted when `effect()` returns it:
+
+- space x `world`: sizes, positions, travel, spawn radii, velocities, accelerations, gravity, floor heights,
+ soft-particle distances;
+- time x `time`: life, delay, interval, fades, flipbook frame lengths and the effect's duration/peak/flight/hold;
+ rates (velocity, spin, UV scroll) divide by it and accelerations by its square.
+
+Why time stretches: a scaled-up explosion that keeps its character-scale timing reads as a miniature. Froude
+similarity says time should grow with sqrt(world); film and games compromise near world ** 0.25 so that a 40x
+kaiju blast lasts 2.5x longer instead of 6.3x (references/scale.md). Profiles carry the agreed numbers; a dict
+gives your own.
+
+Only top-level layers are scaled in space: children live in their parent's coordinate frame and inherit its scale.
+Numbers in `bind` scale; equation strings (`'@In0'`) are world distances the game supplies and stay as they are;
+in a product `[k, '@In1']` only the constant k scales.
+"""
+import copy
+import math
+
+# world: units per Lab unit; time: duration multiplier; budget: particle budget multiplier (bigger screens need more
+# pieces for the same density); camera: Lab stage scale (same as world unless a profile wants a closer look).
+PROFILES = {
+ 'character': dict(world=1.0, time=1.0, budget=1.0),
+ 'giant': dict(world=8.0, time=1.7, budget=2.0), # 14 m creatures, siege machines; time ~ world ** 0.25
+ 'kaiju': dict(world=40.0, time=2.5, budget=3.0), # 70 m monsters, warships, mecha; time ~ world ** 0.25
+}
+TIME_KEYS = ('life', 'delay', 'interval', 'fade_in', 'fade_out')
+RATE_KEYS = ('uv_scroll', 'alpha_scroll', 'distortion_scroll', 'blend_scroll')
+
+
+def profile(scale):
+ """Normalise `scale` ('kaiju', a number for world, or {'world','time','budget'}) to a full profile dict."""
+ if scale is None:
+ return None
+ if isinstance(scale, str):
+ if scale not in PROFILES:
+ raise ValueError(f'Unknown scale profile {scale!r}; use one of {sorted(PROFILES)} or a dict with world/time')
+ return dict(profile=scale, **PROFILES[scale])
+ if isinstance(scale, (int, float)) and not isinstance(scale, bool):
+ scale = dict(world=float(scale))
+ if not isinstance(scale, dict) or set(scale) - {'world', 'time', 'budget', 'profile'}:
+ raise ValueError('scale must be a profile name, a number (world) or a dict with world, time and budget')
+ world = float(scale.get('world', 1))
+ if not world > 0:
+ raise ValueError('scale world must be positive')
+ out = dict(profile=scale.get('profile', 'custom'), world=world, time=float(scale.get('time', round(world ** .25, 3))),
+ budget=float(scale.get('budget', max(1.0, round(world ** .3, 2)))))
+ if not out['time'] > 0 or not out['budget'] >= 1:
+ raise ValueError('scale time must be positive and budget at least 1')
+ return out
+
+
+def _map(value, f):
+ """Apply f to a number, a [min, max] range or a list of those."""
+ if isinstance(value, (list, tuple)):
+ return [_map(v, f) for v in value]
+ return f(value) if isinstance(value, (int, float)) and not isinstance(value, bool) else value
+
+
+def _frames(value, t, minimum=0):
+ return _map(value, lambda v: max(minimum, round(v * t, 3)))
+
+
+def _life(value, t):
+ # Core stores life as integer frames; rounding down keeps every layer inside the stretched duration.
+ return _map(value, lambda v: max(1, math.floor(v * t + 1e-9)))
+
+
+def _time(layer, t):
+ if 'life' in layer:
+ layer['life'] = _life(layer['life'], t)
+ for key in TIME_KEYS[1:]:
+ if key in layer:
+ layer[key] = _frames(layer[key], t)
+ if isinstance(layer.get('flipbook'), dict) and 'frame_length' in layer['flipbook']:
+ layer['flipbook']['frame_length'] = max(1, math.floor(layer['flipbook']['frame_length'] * t + 1e-9))
+ for key in RATE_KEYS:
+ if key in layer:
+ layer[key] = _map(layer[key], lambda v: v / t)
+ if 'spin' in layer:
+ layer['spin'] = _map(layer['spin'], lambda v: v / t)
+
+
+def _space(layer, s, t, top):
+ """Scale lengths by s and convert per-frame rates for the time stretch t. `top`: the layer's own frame is world."""
+ k = s if top else 1.0
+ vel, acc = k / t, k / (t * t)
+ if top:
+ if 'size' in layer:
+ layer['size'] = _map(layer['size'], lambda v: v * s)
+ if 'size_end' in layer:
+ layer['size_end'] = _map(layer['size_end'], lambda v: v * s)
+ elif 'scale_start' in layer:
+ start = layer['scale_start']
+ layer['scale_start'] = _map([start] * 3 if isinstance(start, (int, float)) else start, lambda v: v * s)
+ if 'scale_end' in layer:
+ end = layer['scale_end']
+ layer['scale_end'] = _map([end] * 3 if isinstance(end, (int, float)) else end, lambda v: v * s)
+ elif 'scale' not in (layer.get('bind') or {}):
+ layer['scale_start'] = [s, s, s]
+ for key in ('position',):
+ if key in layer:
+ layer[key] = _map(layer[key], lambda v: v * s)
+ travel = layer.get('travel')
+ if isinstance(travel, dict):
+ for key in ('start', 'end'):
+ if key in travel:
+ travel[key] = _map(travel[key], lambda v: v * s)
+ spawn = layer.get('spawn')
+ if isinstance(spawn, dict):
+ for key in ('radius', 'start', 'end', 'noise'):
+ if key in spawn:
+ spawn[key] = _map(spawn[key], lambda v: v * s)
+ bind = layer.get('bind')
+ if isinstance(bind, dict):
+ # Numbers are Lab-scale constants; equation strings are world values supplied by the game.
+ for key, value in bind.items():
+ bind[key] = [v * s if isinstance(v, (int, float)) and not isinstance(v, bool)
+ else [v[0] * s, v[1]] if isinstance(v, (list, tuple)) else v for v in value]
+ if 'velocity' in layer:
+ layer['velocity'] = _map(layer['velocity'], lambda v: v * vel)
+ if 'acceleration' in layer:
+ layer['acceleration'] = _map(layer['acceleration'], lambda v: v * acc)
+ for force in layer.get('forces') or []:
+ if force.get('type') == 'Gravity' and 'gravity' in force:
+ force['gravity'] = _map(force['gravity'], lambda v: v * acc)
+ elif 'power' in force:
+ force['power'] = force['power'] * vel
+ if top and 'position' in force:
+ force['position'] = _map(force['position'], lambda v: v * s)
+ # World-coordinate quantities scale on every level.
+ if isinstance(layer.get('collide'), dict) and isinstance(layer['collide'].get('height'), (int, float)):
+ layer['collide']['height'] = layer['collide']['height'] * s
+ if isinstance(layer.get('soft'), (int, float)) and not isinstance(layer.get('soft'), bool):
+ layer['soft'] = layer['soft'] * s
+
+
+def _layers(layers, s, t, top=True):
+ for layer in layers:
+ _time(layer, t)
+ inherit = layer.get('inherit') or {}
+ # A child that does not bind its parent's scale lives in world units again.
+ _space(layer, s, t, top or inherit.get('scale') == 'NotBind')
+ _layers(layer.get('children', []), s, t, top=False)
+
+
+def apply(entry, scale):
+ """The effect entry converted to the world of `scale`, with the profile recorded under entry['scale']."""
+ p = profile(scale)
+ entry = copy.deepcopy(entry)
+ s, t = p['world'], p['time']
+ _layers(entry['layers'], s, t)
+ for key in ('duration', 'peak', 'flight', 'hold'):
+ if isinstance(entry.get(key), (int, float)):
+ entry[key] = round(entry[key] * t, 4)
+ if isinstance(entry.get('arc'), (int, float)):
+ entry['arc'] = entry['arc'] * s
+ entry['scale'] = p
+ return entry
+
+
+def factors(recipe):
+ """(world, time, budget) of a built recipe; (1, 1, 1) at character scale."""
+ p = recipe.get('scale') or {}
+ return float(p.get('world', 1)), float(p.get('time', 1)), float(p.get('budget', 1))
diff --git a/skills/effekseer-vfx/scripts/vfxkit/textures.py b/skills/effekseer-vfx/scripts/vfxkit/textures.py
index 21be5d0..5efa880 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/textures.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/textures.py
@@ -56,6 +56,9 @@ def masks(n=256):
out['T_Trail02']=(1-v)**3*np.clip(v/.03,0,1) # clean gradient band without streaks
# Static alpha gradient for columns; the scrolling streaks come from T_NoiseStreak02.
out['T_GradientV01']=v**1.6*np.clip((1-v)/.03,0,1) # procedural mesh V runs top->base: solid at the base, gone at the top
+ # Beam cross-section: soft Gaussian across U, constant along V, so a sprite stretched along V keeps full strength
+ # from end to end (a radial glow stretched into a beam pinches at both ends).
+ out['T_BeamSection01']=np.exp(-(x/.42)**2)*np.clip((1-np.abs(x))/.08,0,1)
# Polar patterns: ground shockwave with radial streaks, and thin speed lines for impacts.
polar=np.random.default_rng(71).random(96)**2
spokes=np.interp((angle+np.pi)/(2*np.pi)*96,np.arange(97),np.append(polar,polar[0]))
diff --git a/skills/vfx-review/SKILL.md b/skills/vfx-review/SKILL.md
index 2f5e606..367d05c 100644
--- a/skills/vfx-review/SKILL.md
+++ b/skills/vfx-review/SKILL.md
@@ -3,7 +3,7 @@ name: vfx-review
description: Independently score one rendered game VFX filmstrip against a fixed rubric and return a JSON verdict. Use when asked to review, score or judge an effect's strip images (for example from the effekseer-vfx skill's `vfx review`) as a reviewer who did not author it.
license: MIT
metadata:
- version: "0.1.0"
+ version: "0.2.0"
---
# Independent VFX review
diff --git a/tests/conftest.py b/tests/conftest.py
index 4cf6d65..b1bb5c2 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2,7 +2,7 @@
vfxkit.paths computes the project ROOT when it is first imported, so this file points VFX_PROJECT at a fresh
temporary game project *before* anything imports vfxkit, initialises its vfx/ workspace without the Godot plugin
-and adds the thirteen shipped example effects. Those examples are the library every library-wide test checks.
+and adds the sixteen shipped example effects. Those examples are the library every library-wide test checks.
Tests that need an isolated workspace either monkeypatch the module-level ROOT/WORK attributes (as the original
pipeline tests did) or run the CLI in a subprocess with --project.
@@ -76,5 +76,5 @@ def cli_env(**extra):
@pytest.fixture
def project():
- """The shared temporary game project whose vfx/src holds the thirteen examples."""
+ """The shared temporary game project whose vfx/src holds the sixteen examples."""
return PROJECT
diff --git a/tests/test_examples.py b/tests/test_examples.py
index f13f311..4794971 100644
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -13,13 +13,16 @@ def example_ids():
return sorted(p.stem for p in (EXAMPLES / 'src').glob('VFX_*.py'))
-def test_catalog_lists_every_shipped_example_as_pairs_and_singles():
+def test_catalog_lists_every_shipped_example_as_pairs_singles_and_sets():
from vfxkit import examples
catalog = examples.catalog()
ids = examples.ids('all')
- assert sorted(ids) == example_ids() and len(ids) == len(set(ids)) == 13
+ assert sorted(ids) == example_ids() and len(ids) == len(set(ids)) == 16
assert [p['name'] for p in catalog['pairs']] == ['fire', 'ice', 'poison', 'dark']
assert [s['name'] for s in catalog['singles']] == ['hit', 'slash', 'charge', 'shield', 'heal']
+ assert [s['name'] for s in catalog['sets']] == ['kaiju']
+ assert examples.ids('kaiju') == ['VFX_Kaiju_Atomic_Charge', 'VFX_Kaiju_Atomic_Beam', 'VFX_Kaiju_Explosion']
+ assert catalog['sets'][0]['teaches']
for pair in catalog['pairs']:
assert examples.ids(pair['name']) == [pair['projectile'], pair['impact']]
assert pair['teaches']
diff --git a/tests/test_package.py b/tests/test_package.py
index 6354e7e..b6f43e1 100644
--- a/tests/test_package.py
+++ b/tests/test_package.py
@@ -88,7 +88,7 @@ def test_launchers_keep_the_line_endings_their_shells_need():
def test_doctor_reports_an_initialised_workspace(project):
code, result = vfx('--project', str(project), 'doctor')
assert code == 0 and result['modes']['authoring']
- assert result['workspace']['initialized'] and result['workspace']['effects'] == 13
+ assert result['workspace']['initialized'] and result['workspace']['effects'] == 16
def test_help_lists_commands_without_dependencies(tmp_path):
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index d1b16f7..02a9f4d 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -233,12 +233,13 @@ def test_library_recipes_are_valid_without_core_or_assets():
available = set(masks(16)) | EXTRA_PROCEDURAL | {p['id'] for p in json.loads((ROOT / 'vfx/texture_prompts.json').read_text())['prompts']}
recipes = library()
ids = [r['id'] for r in recipes]
- assert len(set(ids)) == len(ids) == 13
+ assert len(set(ids)) == len(ids) == 16
for recipe in recipes:
layers = list(walk(recipe['layers']))
assert recipe['design'] and len(layers) >= 4, recipe['id']
- assert max(lifetime(layer, release=recipe.get('flight', 0) * 60) for layer in recipe['layers']) <= recipe['duration'] * 60, recipe['id']
- assert sum(budget(layer) for layer in recipe['layers']) <= 250, recipe['id']
+ release = (recipe.get('flight') or recipe.get('hold') or 0) * 60
+ assert max(lifetime(layer, release=release) for layer in recipe['layers']) <= recipe['duration'] * 60, recipe['id']
+ assert sum(budget(layer) for layer in recipe['layers']) <= 250 * (recipe.get('scale') or {}).get('budget', 1), recipe['id']
for layer in layers:
for key in TEXTURE_KEYS:
# Every input is either a math primitive or has a recorded image prompt; nothing is undocumented.
@@ -253,7 +254,7 @@ def test_every_effect_declares_how_a_game_delivers_it():
from vfxkit.library import library
recipes = library()
by_id = {r['id']: r for r in recipes}
- kinds = {'self', 'melee', 'projectile', 'targeted', 'area'}
+ kinds = {'self', 'melee', 'projectile', 'targeted', 'area', 'beam'}
for recipe in recipes:
delivery = recipe.get('delivery') or {}
assert delivery.get('kind') in kinds, recipe['id']
@@ -262,6 +263,10 @@ def test_every_effect_declares_how_a_game_delivers_it():
assert any((r.get('delivery') or {}).get('projectile') == recipe['id'] for r in recipes), f"{recipe['id']} has no impact effect"
elif delivery['kind'] == 'projectile':
assert by_id[delivery['projectile']]['category'] == 'projectile', recipe['id']
+ elif delivery['kind'] == 'beam':
+ # A beam is held by the game: the Lab fires it for `hold` seconds; its optional charge must exist.
+ assert recipe.get('hold') and recipe.get('inputs'), recipe['id']
+ assert delivery.get('charge') is None or delivery['charge'] in by_id, recipe['id']
def test_sustained_layers_live_until_release_and_budget_by_overlap():
diff --git a/tests/test_scale_beam.py b/tests/test_scale_beam.py
new file mode 100644
index 0000000..04bd1f5
--- /dev/null
+++ b/tests/test_scale_beam.py
@@ -0,0 +1,283 @@
+"""World scale, game-driven bind equations, beams, charge chains and soft particles.
+
+The Core round trips are marked requires_core; everything else is pure Python."""
+import copy
+import math
+
+import pytest
+
+from conftest import ASSETS, requires_core
+
+
+def recipe_with(layers, **kw):
+ from vfxkit.primitives import effect
+ return effect('Scale_Test', 'Scale test', 'hit', 'physical', 1.0, layers, **kw)
+
+
+# ---------------------------------------------------------------- scale
+
+def test_scale_profiles_numbers_and_dicts():
+ from vfxkit.scale import profile, PROFILES
+ assert profile(None) is None
+ kaiju = profile('kaiju')
+ assert kaiju == dict(profile='kaiju', **PROFILES['kaiju']) and kaiju['world'] == 40 and kaiju['time'] == 2.5
+ custom = profile(16)
+ assert custom['world'] == 16 and custom['time'] == pytest.approx(2.0) and custom['budget'] >= 1
+ assert profile({'world': 10, 'time': 1, 'budget': 2}) == dict(profile='custom', world=10.0, time=1.0, budget=2.0)
+ for bad in ('huge', {'world': 0}, {'world': 4, 'speed': 2}, {'world': 4, 'time': -1}, {'world': 4, 'budget': .5}, True):
+ with pytest.raises(ValueError):
+ profile(bad)
+
+
+def test_scale_converts_space_on_top_level_layers_and_time_everywhere():
+ from vfxkit.scale import apply
+ layer = {'name': 'Top', 'life': [10, 20], 'delay': 3, 'interval': 2, 'fade_in': 1, 'fade_out': 4, 'size': [.5, .8], 'size_end': [.2, .4],
+ 'position': [0, 1, 0], 'velocity': [0, .02, 0], 'acceleration': [0, -.001, 0], 'spin': [0, 0, 6], 'uv_scroll': [0, .01],
+ 'travel': {'end': [0, [1, 2], 0]}, 'spawn': {'shape': 'Sphere', 'radius': [0, .3]}, 'soft': .2,
+ 'forces': [{'type': 'Gravity', 'gravity': [0, -.002, 0]}, {'type': 'Turbulence', 'power': .01}],
+ 'collide': {'height': .02}, 'flipbook': {'x': 4, 'y': 4, 'frame_length': 3},
+ 'children': [{'name': 'Child', 'life': 8, 'size': .3, 'position': [0, .5, 0], 'velocity': [.01, 0, 0],
+ 'forces': [{'type': 'Gravity', 'gravity': [0, -.002, 0]}], 'collide': {'height': .02}},
+ {'name': 'Free child', 'life': 8, 'size': .3, 'inherit': {'scale': 'NotBind'}}]}
+ entry = {'id': 'VFX_T', 'duration': 1.0, 'peak': .1, 'hold': 2.0, 'arc': .5, 'layers': [layer]}
+ before = copy.deepcopy(entry)
+ out = apply(entry, {'world': 10, 'time': 2})
+ assert entry == before, 'apply must not mutate its input'
+ top, child, free = out['layers'][0], out['layers'][0]['children'][0], out['layers'][0]['children'][1]
+ assert out['duration'] == 2 and out['peak'] == .2 and out['hold'] == 4 and out['arc'] == 5
+ assert out['scale'] == dict(profile='custom', world=10.0, time=2.0, budget=pytest.approx(10 ** .3, rel=.01))
+ # time
+ assert top['life'] == [20, 40] and top['delay'] == 6 and top['interval'] == 4 and top['fade_out'] == 8
+ assert top['flipbook']['frame_length'] == 6 and top['uv_scroll'] == [0, .005] and top['spin'] == [0, 0, 3]
+ assert child['life'] == 16
+ # space on the top-level layer: lengths x10, velocity x10/2, acceleration and gravity x10/4
+ assert top['size'] == [5, 8] and top['size_end'] == [2, 4] and top['position'] == [0, 10, 0]
+ assert top['travel']['end'] == [0, [10, 20], 0] and top['spawn']['radius'] == [0, 3]
+ assert top['velocity'] == [0, pytest.approx(.1), 0] and top['acceleration'] == [0, pytest.approx(-.0025), 0]
+ assert top['forces'][0]['gravity'][1] == pytest.approx(-.005) and top['forces'][1]['power'] == pytest.approx(.05)
+ assert top['soft'] == pytest.approx(2) and top['collide']['height'] == pytest.approx(.2)
+ # a child lives in its parent's (already scaled) frame: only time and world-coordinate fields change
+ assert child['size'] == .3 and child['position'] == [0, .5, 0] and child['velocity'] == [pytest.approx(.005), 0, 0]
+ assert child['forces'][0]['gravity'][1] == pytest.approx(-.0005) and child['collide']['height'] == pytest.approx(.2)
+ # ...unless it does not bind its parent's scale
+ assert free['size'] == pytest.approx(3)
+
+
+def test_scale_gives_unsized_layers_a_node_scale_and_keeps_bind_equations_in_world_units():
+ from vfxkit.scale import apply
+ ring = {'name': 'Ring', 'renderer': 'Ring', 'life': 10}
+ bound = {'name': 'Beam', 'life': 10, 'bind': {'scale': [[.5, '@In1'], '@In0', 1], 'position': [0, '@In0', .2]}}
+ out = apply({'id': 'VFX_T', 'duration': 1, 'layers': [ring, bound]}, 'kaiju')
+ assert out['layers'][0]['scale_start'] == [40, 40, 40]
+ assert out['layers'][1]['bind'] == {'scale': [[20, '@In1'], '@In0', 40], 'position': [0, '@In0', 8]}
+ assert 'scale_start' not in out['layers'][1]
+
+
+def test_scaled_life_rounds_down_so_layers_stay_inside_the_stretched_duration():
+ from vfxkit.primitives import effect, lifetime, glow
+ recipe = effect('Fit', 'Fit', 'hit', 'physical', .5, [glow('Glow', (255, 255, 255, 255), 1, life=29, delay=1)], scale={'world': 3, 'time': 1.37})
+ assert all(lifetime(layer) <= recipe['duration'] * 60 for layer in recipe['layers'])
+ assert isinstance(recipe['layers'][0]['life'], int)
+
+
+def test_scale_character_is_a_no_op_and_records_nothing():
+ from vfxkit.primitives import glow
+ plain = recipe_with([glow('Glow', (255, 255, 255, 255), 1)])
+ assert recipe_with([glow('Glow', (255, 255, 255, 255), 1)], scale='character') == plain and 'scale' not in plain
+
+
+def test_lint_scales_its_craft_limits_with_the_recipe():
+ from vfxkit.lint import lint
+ from vfxkit.primitives import radial_sparks, flash
+ known = ({'T_Spark01', 'T_Flare01'}, set())
+ sparks = radial_sparks('Sparks', 70, (255, 200, 120, 255), gravity=.009)
+ # A 15-frame flash is too long for a character-scale contact...
+ plain = lint(recipe_with([flash('Flash', (255, 255, 255, 255), 1, life=15, delay=6), copy.deepcopy(sparks)], impact=.5), known)
+ assert any('particle budget' in e for e in plain['errors'])
+ assert any('contact flash lives' in w for w in plain['warnings'])
+ # ...but it is what a 6-frame Lab flash becomes at kaiju time (x2.5), and the budget triples.
+ scaled = lint(recipe_with([flash('Flash', (255, 255, 255, 255), 1, life=6, delay=2), copy.deepcopy(sparks)], impact=.5, scale='kaiju'), known)
+ assert scaled['budget'][1] == 180 and not any('particle budget' in e for e in scaled['errors'])
+ assert not any('contact flash lives' in w for w in scaled['warnings'])
+ # gravity limit: .009 * 40 / 2.5^2 = .0576 is still legal because the limit scales the same way
+ assert not any('gravity' in e for e in scaled['errors'])
+
+
+def test_shipped_kaiju_examples_are_scaled_and_record_their_profile():
+ from vfxkit.library import load
+ for rid in ('VFX_Kaiju_Atomic_Charge', 'VFX_Kaiju_Atomic_Beam', 'VFX_Kaiju_Explosion'):
+ recipe = load(ASSETS / f'examples/src/{rid}.py')
+ assert recipe['scale']['profile'] == 'kaiju' and recipe['scale']['world'] == 40
+
+
+# ---------------------------------------------------------------- bind and inputs
+
+def test_bind_components_and_equations_are_validated():
+ from effekseer_ai.authoring import validate_layer, _code
+ ok = {'name': 'B', 'bind': {'scale': [[.5, '@In1'], '@In0', 1], 'position': [0, '@In0 * 0.5', 0]}}
+ assert validate_layer(ok) == []
+ assert _code([.5, '@In1']) == '0.5 * (@In1)' and _code(2) == '2.0' and _code('@In0') == '@In0'
+ for bad in ({'scale': [1, 2]}, {'scale': [1, True, 1]}, {'position': [0, '@In0; os.system(1)', 0]},
+ {'position': [0, ['@In0', 1], 0]}, {'rotation': [0, 0, 0]}):
+ assert validate_layer({'name': 'B', 'bind': bad}), bad
+
+
+def test_lint_rejects_bind_conflicts_and_missing_input_defaults():
+ from vfxkit.lint import lint
+ known = ({'T_Glow01'}, set())
+ from vfxkit.primitives import sprite
+ def errors(layer, **kw):
+ return lint(recipe_with([layer], **kw), known)['errors']
+ assert any('bind.scale replaces' in e for e in errors(sprite('A', size=1, bind={'scale': [1, '@In0', 1]}), inputs=[1, 0, 0, 0]))
+ assert any('bind.position fixes' in e for e in errors(sprite('A', travel={'end': [0, 1, 0]}, bind={'position': [0, '@In0', 0]}), inputs=[1, 0, 0, 0]))
+ assert any('give the recipe inputs' in e for e in errors(sprite('A', bind={'position': [0, '@In2', 0]}), inputs=[1, 1]))
+ assert any('four game inputs' in e for e in errors(sprite('A', bind={'position': [0, '@In5', 0]}), inputs=[1, 1, 1, 1]))
+ assert not errors(sprite('A', bind={'position': [0, '@In1', 0]}), inputs=[1, 1, 0, 0])
+
+
+@requires_core
+def test_bind_equations_and_input_defaults_survive_core_save_open(tmp_path):
+ from effekseer_ai.authoring import compile_effect
+ from effekseer_ai.session import EffectSession
+ from effekseer_ai.runtime import load_core
+ source = tmp_path / 'bind.efkefc'
+ compile_effect({'duration': 1, 'inputs': [7, 1, 0, 0], 'layers': [
+ {'name': 'Strip', 'life': 12, 'bind': {'scale': [[.5, '@In1'], '@In0', 1]}},
+ {'name': 'End', 'life': 12, 'bind': {'position': [0, '@In0', 0]}},
+ {'name': 'Same', 'life': 12, 'bind': {'position': [0, '@In0', 0]}}]}, source, tmp_path / 'bind.efk')
+ session = EffectSession.open(source)
+ core = load_core()
+ assert [float(i.Input.Value) for i in core.Dynamic.Inputs.Values][:2] == [7, 1]
+ assert len(list(core.Dynamic.Equations.Values)) == 2, 'identical equations are shared'
+ strip = session._object_at_path('node/root/0/ScalingValues/Fixed/Scale')
+ end = session._object_at_path('node/root/1/LocationValues/Fixed/Location')
+ assert session.property_get('node/root/0/ScalingValues/Type/Value') == 'Fixed'
+ assert strip.IsDynamicEquationEnabled.Value and strip.DynamicEquation.Value.Code.Value == '@O.x = 0.5 * (@In1)\[email protected] = @In0\[email protected] = 1.0'
+ assert end.DynamicEquation.Value.Code.Value == '@O.x = 0.0\[email protected] = @In0\[email protected] = 0.0'
+ assert (tmp_path / 'bind.efk').read_bytes()[:4] == b'SKFE'
+
+
+# ---------------------------------------------------------------- beam and charge
+
+def test_beam_layers_are_held_axial_strips_bound_to_length_and_power():
+ from vfxkit.primitives import beam, walk, held, BEAM_LENGTH, BEAM_POWER
+ layers = beam('Ray', (255, 255, 255, 255), (60, 150, 255, 255), (25, 60, 220, 130), width=.5, interval=6, steam=(200, 200, 200, 120))
+ names = [l['name'] for l in layers]
+ assert names[:4] == ['Ray haze', 'Ray rim', 'Ray body', 'Ray core'] and names[-1] == 'Ray hit point'
+ for strip in layers[:4]:
+ assert strip['billboard'] == 'YAxisFixed' and strip['pivot'] == 'bottom'
+ assert strip['bind']['scale'][1] == BEAM_LENGTH and strip['bind']['scale'][0][1] == BEAM_POWER
+ for layer in layers:
+ assert layer['infinite'] and layer['life'] == 2 * layer['interval'] and layer['interval'] == 6
+ for point in (l for l in layers if ' end ' in l['name'] or l['name'].endswith('hit point')):
+ assert point['bind']['position'] == [0, BEAM_LENGTH, 0]
+ children = layers[-1]['children']
+ assert [c['name'] for c in children] == ['Ray end sparks', 'Ray end steam']
+ assert all(c['inherit']['location'] == 'WhenCreating' for c in children) and children[1]['soft'] > 0
+ # held(): instance alphas fade in and out over one interval each, so two overlapping instances sum to a constant
+ one = held({'name': 'X'}, 5)
+ assert one['fade_in'] == one['fade_out'] == one['interval'] == 5 and one['life'] == 10
+ assert not [l for l in beam('Plain', (255,) * 4, (0, 0, 255, 255), (0, 0, 255, 100), haze=0, sparks=0) if 'haze' in l['name'] or 'hit point' in l['name']]
+
+
+def test_beam_recipe_lints_with_hold_and_needs_a_release():
+ from vfxkit.lint import lint
+ from vfxkit.primitives import beam, beam_inputs, flash, BEAM
+ known = ({'T_Glow01', 'T_Flare01', 'T_BeamSection01', 'T_NoiseStreak02', 'T_DistortHaze01', 'T_Spark01', 'T_SmokeSheet01', 'T_NoiseTile01'}, set())
+ layers = beam('Ray', (255,) * 4, (60, 150, 255, 255), (25, 60, 220, 130)) + [flash('Ignition', (255,) * 4, 1, delay=1)]
+ good = recipe_with(copy.deepcopy(layers), delivery=BEAM, hold=1.0, inputs=beam_inputs(10), peak=.02, impact=.5)
+ good['duration'] = 2.0
+ report = lint(good, known)
+ assert not [e for e in report['errors'] if 'missing' not in e], report['errors']
+ unheld = recipe_with(copy.deepcopy(layers), delivery=BEAM, inputs=beam_inputs(10))
+ assert any('needs flight' in e and 'or hold' in e for e in lint(unheld, known)['errors'])
+ assert beam_inputs(12) == [12, 1.0, 0, 0]
+
+
+def test_charge_chain_aims_each_arc_at_the_next_anchor_and_lights_in_order():
+ from vfxkit.primitives import charge_chain
+ anchors = [(0, 0, 0), (0, 1, 0), (1, 1, 1)]
+ layers = charge_chain('Plates', anchors, (70, 150, 255, 255), (225, 245, 255, 255), step=4, until=40)
+ nodes = [l for l in layers if l['name'].endswith(('node 1', 'node 2', 'node 3'))]
+ assert [n['delay'] for n in nodes] == [0, 4, 8] and [n['position'] for n in nodes] == [list(a) for a in anchors]
+ arcs = [l for l in layers if ' arc ' in l['name']]
+ assert {a['name'][-2:] for a in arcs} == {'1a', '1b', '2a', '2b'}
+ for arc in arcs:
+ i = int(arc['name'].split(' arc ')[1][0]) - 1
+ start, end = anchors[i], anchors[i + 1]
+ length = math.dist(start, end)
+ direction = [(b - a) / length for a, b in zip(start, end)]
+ speed = math.sqrt(sum(v * v for v in arc['velocity']))
+ assert arc['billboard'] == 'DirectionalBillboard' and arc['pivot'] == 'bottom' and arc['position'] == list(start)
+ assert speed < 1e-3 and [v / speed for v in arc['velocity']] == pytest.approx(direction)
+ assert abs(arc['scale_start'][1]) == pytest.approx(length)
+ mirrored = {a['name'][-1]: a['scale_start'][0] for a in arcs if a['name'].startswith('Plates arc 1')}
+ assert mirrored['a'] == -mirrored['b']
+ with pytest.raises(ValueError):
+ charge_chain('One', [(0, 0, 0)], (0, 0, 255, 255), (255,) * 4)
+
+
+def test_lint_counts_repeatedly_emitted_painted_shapes_as_restruck():
+ from vfxkit.lint import lint
+ from vfxkit.primitives import charge_chain, flash
+ known = ({'T_Glow01', 'T_Flare01'}, {'T_ArcStrand01'})
+ layers = charge_chain('Plates', [(0, 0, 0), (0, 1, 0)], (70, 150, 255, 255), (225, 245, 255, 255), until=30)
+ report = lint(recipe_with(layers + [flash('F', (255,) * 4, 1, delay=6)], impact=.3), known)
+ assert not any('no layer changes shape' in w for w in report['warnings'])
+
+
+# ---------------------------------------------------------------- soft particles
+
+def test_soft_must_be_a_positive_distance_and_warns_when_it_swallows_the_card():
+ from vfxkit.lint import lint
+ from vfxkit.primitives import sprite
+ known = ({'T_SoftCircle'}, set())
+ def report(**kw):
+ return lint(recipe_with([sprite('Card', 'T_SoftCircle', size=1.0, **kw)]), known)
+ assert any('soft is the fade distance' in e for e in report(soft=0)['errors'])
+ assert any('soft is the fade distance' in e for e in report(soft=True)['errors'])
+ assert any('close to the particle size' in w for w in report(soft=.9)['warnings'])
+ assert not report(soft=.3)['errors'] and not any('soft' in w for w in report(soft=.3)['warnings'])
+
+
+# ---------------------------------------------------------------- review metrics and the Lab
+
+def test_review_tolerances_stretch_with_scaled_time_and_skip_beam_contact(tmp_path):
+ from PIL import Image
+ from vfxkit.review import metrics
+ size = (1280, 800)
+ base = Image.new('RGB', size, (10, 12, 18))
+ base.save(tmp_path / 'X_f000.png')
+ for f in range(4, 61, 4):
+ frame = base.copy()
+ if f == 40: # the whitest frame is far from the manifest peak
+ frame.paste((255, 255, 255), (500, 300, 640, 420))
+ else:
+ frame.paste((40, 120, 255), (500, 300, 600, 400))
+ frame.save(tmp_path / f'X_f{f:03d}.png')
+ entry = {'id': 'X', 'duration': 1.0, 'peak': .05, 'impact': .6}
+ flags = metrics('X', tmp_path, entry)['flags']
+ assert any('off-peak contact' in f for f in flags)
+ beam = metrics('X', tmp_path, entry | {'delivery': {'kind': 'beam'}})['flags']
+ assert not any('off-peak contact' in f for f in beam)
+ # 36 frames off at 2.5x time is inside the stretched tolerance (max(6, 8) * 2.5 = 20 frames? no: 36 > 20)
+ stretched = metrics('X', tmp_path, entry | {'scale': {'time': 5.0}})['flags']
+ assert not any('off-peak contact' in f for f in stretched)
+
+
+def test_lab_scales_its_stage_and_stages_beams():
+ lab = (ASSETS / 'godot-lab/scripts/VfxLab.gd').read_text()
+ api = (ASSETS / 'godot-lab/scripts/Vfx.gd').read_text()
+ handle = (ASSETS / 'godot-lab/scripts/VfxHandle.gd').read_text()
+ test = (ASSETS / 'godot-lab/scripts/TestApi.gd').read_text()
+ assert 'func _set_stage_scale' in lab and '"beam":' in lab and 'beam_handle.aim(' in lab and 'beam_handle.release()' in lab
+ assert 'func beam(' in api and 'handle.inputs[i]' in api
+ assert 'func aim(' in handle and 'func start_beam(' in handle and 'emitter.set_dynamic_input(i, inputs[i])' in handle
+ assert 'manager.beam(' in test
+
+
+def test_beam_cross_section_is_full_strength_along_its_length():
+ from vfxkit.textures import masks
+ section = masks(64)['T_BeamSection01']
+ assert section[:, 32].std() == pytest.approx(0, abs=1e-9) # constant along V
+ assert section[10, 32] > .9 and section[10, 1] < .05 # bright centre, gone at the edges
diff --git a/tests/test_workflow.py b/tests/test_workflow.py
index 946401a..e317920 100644
--- a/tests/test_workflow.py
+++ b/tests/test_workflow.py
@@ -29,7 +29,7 @@ def test_briefs_expand_child_births_and_validate_the_shipped_examples():
bad['beats'][0]['frame'] = .3
assert not briefs.validate(bad, recipe)['ok']
checked += 1
- assert checked == 13
+ assert checked == 16
duplicate = briefs.timeline([{'name': 'same'}, {'name': 'same'}])
assert duplicate[0]['path'] != duplicate[1]['path']
assert not briefs.validate(None, library()[0])['ok']