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
Animate dissolve thresholds in Godot: compile cutoffs to Easing; fix decal textures
KanaWorks_AId2f28031ac62
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex e1e8e6a..d18abeb 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.0"+ "version": "0.1.1"}]}diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 29fb155..1dfc9b5 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "effekseer-vfx",- "version": "0.1.0",+ "version": "0.1.1","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/docs/ja/references/cases.md b/docs/ja/references/cases.mdindex e87884b..4307d3e 100644--- a/docs/ja/references/cases.md+++ b/docs/ja/references/cases.md@@ -69,7 +69,7 @@ f27 では BEFORE の経路の始まりにもう煙がありませんが、AFTER元の反復では幾何的な隙間が先に機能しましたが、f108 にまだ大きな破片が残っており、独立レビューの判定はまだ iterate でした。さらに 1 ラウンドで破片のライフと RGB の減衰を調整し、退場を仕上げました。新しい形を足しても、最後のフレームの言い訳にはなりません。この失敗が示すのは、このシェルのマテリアルの組み合わせが目に見えて侵食しないということだけで、Model レイヤーがアルファカットオフを-決してサポートしないということではありません。また、修正は公式レンダラーをそのまま使いました。+決してサポートしないということではありません。また、修正は公式レンダラーをそのまま使いました。その後の計測で原因が分かりました。Godot のランタイムでは FCurve のカットオフしきい値が最初のキーから動かないため、どのカットオフカーブも侵食していませんでした([エンジンの規約](engine-conventions.md)を参照)。現在カットオフは常に Easing にコンパイルされます。破片は引き続き読みやすい壊れ方として残しています。## ケースの使い方diff --git a/docs/ja/references/engine-conventions.md b/docs/ja/references/engine-conventions.mdindex 74d7e8b..d7f447f 100644--- a/docs/ja/references/engine-conventions.md+++ b/docs/ja/references/engine-conventions.md@@ -66,6 +66,13 @@- **UV ディストーションのテクスチャは不透明な RG オフセットマップでなければなりません**(`T_Distort01/02`)。アルファ上の白いマスクをディストーションマップとして使っても、何も歪みません。- **アルファテクスチャはアルファチャンネルを読みます**。`T_Noise*` のマスクはどれも `cutoff` のディゾルブにそのまま使えます。+- **ディゾルブのしきい値は Easing でないと動きません。** Godot の描画で計測しました(EffekseerForGodot4 1.80.5.1、Lab と+ Mobile レンダラーのゲーム)。`AlphaCutoffParam/Type = FCurve`(Percent でも Time でも)のしきい値は寿命の間ずっと最初の+ キーのままで、形は侵食されません。`Type = Easing` なら動き、カーブの形はイージングの種類(`Linear`、`EaseInQuadratic`、+ `EaseInCubic`、`EaseInQuartic`、`EaseInQuintic`、`EaseOut*`)で決まります。Core は開始・終了しきい値を 0..1 に丸めるので、+ 「保ってから侵食する」形は負の開始値ではなく ease-in で作ります。コンパイラは常に Easing を書きます。正確に制御するなら+ `cutoff=dict(start=a, end=b, easing='EaseInQuadratic')`、カーブ `[[percent, value], ...]` を書けば最も近いイージングに+ 当てはめます(`cutoff_easing`)。読み戻しだけでは分からないので、ストリップを見てください。- **フリップブックの整数**:`flipbook.frame_length`、`x`、`y` は Core の整数プロパティで、正の整数でなければなりません(4.5 はネイティブで拒否され、その前にフィールドのバリデータが捕まえます)。再生を長くするには、整数のフレーム長とライフを一緒に延ばします。- **フリップブックに UV ディストーションをかけない**:`distortion_intensity` はテクスチャ全体の UV で測られるので、4×4 シートで 0.12 はdiff --git a/docs/ja/references/primitives.md b/docs/ja/references/primitives.mdindex 2987fe0..0c2da9f 100644--- a/docs/ja/references/primitives.md+++ b/docs/ja/references/primitives.md@@ -67,7 +67,7 @@|---|---|| `ramp((0,c0),(30,c1),(100,c2))` | 3〜5 個のストップによるライフ上の色 → `color_curve`(2 色の線形補間は色味付けに見える) || `fade(color, alpha=0)` | 同じ RGB で新しいアルファ |-| `POP`, `DISSOLVE` | パッと出てから漂うスケールカーブ。保持してから侵食するカットオフカーブ |+| `POP`, `DISSOLVE` | パッと出てから漂うスケールカーブ。保持(ease-in)してから侵食するカットオフのイージング || `sustain(layer, interval)` | 飛翔体のエミッター:解放まで `interval` フレームごとにインスタンスを一つ || `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` = (残像, 本体, 縁) |@@ -88,5 +88,5 @@ save/open の読み戻しテストとともにコンパイラに追加しなけ## 単位レイヤーの `life`、`delay`、`interval`:60 FPS のフレーム数。速度と加速度:units per frame。重力:units per frame²。-角度:度。色:RGBA 0–255。カーブ(`size_curve`、`cutoff`、`color_curve` など):`[[percent_of_life, value], ...]`。+角度:度。色:RGBA 0–255。カーブ(`size_curve`、`color_curve` など):`[[percent_of_life, value], ...]`。`cutoff`(ディゾルブのしきい値、0..1)は数値(固定)、`dict(start=a, end=b, easing='Linear')`(粒子の寿命にわたって変化し、`EaseIn*` は形をしばらく保ちます)、またはカーブ(コンパイラが最も近いイージングに当てはめます)です。FCurve のしきい値は Godot では動きません([エンジンの規約](engine-conventions.md)を参照)。マニフェストの `duration` と `peak`:秒。ランダムな範囲は `[min, max]`。diff --git a/docs/zh/references/cases.md b/docs/zh/references/cases.mdindex 922b881..d4f7852 100644--- a/docs/zh/references/cases.md+++ b/docs/zh/references/cases.md@@ -62,7 +62,7 @@ AFTER 在 f80 把壳交接给六片真实的球面碎片,它们带着可见的在最初的迭代中,几何间隙先成立了,但 f108 时仍残留大碎片,独立评审仍然给出 iterate;又一轮调整了碎片寿命和 RGB 衰减,完成了退场。加入新形状不能成为忽视最后一帧的理由。这次失败只说明这种壳材质组合不会可见地侵蚀 —— 并不说明 Model 层从不支持 alpha cutoff ——-而且修复保留了官方渲染器。+而且修复保留了官方渲染器。后来的测量找到了原因:在 Godot 运行时中,FCurve 的 cutoff 阈值始终停在第一个关键帧,所以任何 cutoff 曲线都不会侵蚀(见[引擎约定](engine-conventions.md))。现在 cutoff 一律编译为 Easing;碎片仍然是可读的破碎表现。## 使用案例diff --git a/docs/zh/references/engine-conventions.md b/docs/zh/references/engine-conventions.mdindex 37dc090..b8ae401 100644--- a/docs/zh/references/engine-conventions.md+++ b/docs/zh/references/engine-conventions.md@@ -49,6 +49,12 @@- **UV 扰动纹理必须是不透明的 RG 偏移图**(`T_Distort01/02`)。把白色带 alpha 的遮罩用作扰动图,什么也不会扭曲。- **Alpha 纹理读取 alpha 通道**;每个 `T_Noise*` 遮罩都可以直接用于 `cutoff` 溶解。+- **溶解阈值只有写成 Easing 才会动。** 在 Godot 渲染中实测(EffekseerForGodot4 1.80.5.1,Lab 与 Mobile 渲染器游戏):+ `AlphaCutoffParam/Type = FCurve`(Percent 或 Time 时间轴)时,阈值整个生命周期都停在第一个关键帧,形状永远不会被侵蚀;+ `Type = Easing` 时会正常变化,曲线形状由缓动类型决定(`Linear`、`EaseInQuadratic`、`EaseInCubic`、`EaseInQuartic`、+ `EaseInQuintic`、`EaseOut*`)。Core 会把起止阈值限制在 0..1,所以“先保持再侵蚀”要用 ease-in,而不是负的起始值。+ 编译器总是写成 Easing:需要精确控制时写 `cutoff=dict(start=a, end=b, easing='EaseInQuadratic')`;写曲线+ `[[percent, value], ...]` 时,编译器会用最接近的缓动拟合(`cutoff_easing`)。仅靠读回无法发现这个问题,要看条带图。- **序列帧整数**:`flipbook.frame_length`、`x` 和 `y` 是 Core 的整数属性,必须是正整数(4.5 会被原生拒绝;字段校验器会先拦下它)。要延长播放,就同时调整整数的帧长度和寿命。- **序列帧上不能用 UV 扰动**:`distortion_intensity` 以整张纹理的 UV 计量,所以在 4×4 图集上 0.12 会偏移半格,采样到相邻帧 ——diff --git a/docs/zh/references/primitives.md b/docs/zh/references/primitives.mdindex 0446e0c..ba436b7 100644--- a/docs/zh/references/primitives.md+++ b/docs/zh/references/primitives.md@@ -63,7 +63,7 @@|---|---|| `ramp((0,c0),(30,c1),(100,c2))` | 用 3–5 个节点描述随寿命变化的颜色 → `color_curve`(两色插值读起来只是一层色调) || `fade(color, alpha=0)` | 相同的 RGB,新的 alpha |-| `POP`、`DISSOLVE` | 先弹出再缓慢漂移的缩放曲线;先保持再侵蚀的 cutoff 曲线 |+| `POP`、`DISSOLVE` | 先弹出再缓慢漂移的缩放曲线;先保持(ease-in)再侵蚀的 cutoff 缓动 || `sustain(layer, interval)` | 飞行体发射器:每 `interval` 帧一个实例,直到释放 || `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` = (残影, 主体, 热边) |@@ -82,5 +82,5 @@## 单位层的 `life`、`delay`、`interval`:60 FPS 帧数。速度和加速度:单位/帧;重力:单位/帧²。角度:度。颜色:RGBA 0–255。-曲线(`size_curve`、`cutoff`、`color_curve` 等):`[[percent_of_life, value], ...]`。manifest 的 `duration` 和 `peak`:秒。+曲线(`size_curve`、`color_curve` 等):`[[percent_of_life, value], ...]`。`cutoff`(溶解阈值,0..1)可以是数字(固定)、`dict(start=a, end=b, easing='Linear')`(在粒子生命周期内变化,`EaseIn*` 会先保持形状),或者曲线(编译器会拟合为最接近的缓动)——FCurve 阈值在 Godot 中不会变化(见[引擎约定](engine-conventions.md))。manifest 的 `duration` 和 `peak`:秒。随机范围写作 `[min, max]`。diff --git a/skills/effekseer-vfx/SKILL.md b/skills/effekseer-vfx/SKILL.mdindex e11b29e..54aab3c 100644--- a/skills/effekseer-vfx/SKILL.md+++ b/skills/effekseer-vfx/SKILL.md@@ -4,7 +4,7 @@ description: Author real-time game VFX as code for the Effekseer engine and verilicense: MITcompatibility: 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.0"+ version: "0.1.1"---# Effekseer VFXdiff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Dark_Vortex.py b/skills/effekseer-vfx/assets/examples/src/VFX_Dark_Vortex.pyindex e80c4d9..75d5365 100644--- a/skills/effekseer-vfx/assets/examples/src/VFX_Dark_Vortex.py+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Dark_Vortex.py@@ -51,14 +51,14 @@ def recipe():sprite('Impact frame','T_SoftCircle',(4,0,10,215),life=2,delay=62,size=26,billboard='Billboard',blend='Blend',fade_in=0,fade_out=1),# Contact: a narrow hot disk rim preserves the absorptive centre; the slice carries the brightest accent.wisps('Collapse rim',pale,.8,count=1,width=.095,sweep=(0,285),life=5,delay=62,tilt=DISK,size=1,broken=.1,emissive=2.0),- sprite('Collapse core','T_Smoke02',(8,2,18,245),life=8,delay=61,size=1.2,size_curve=[[0,1],[35,.85],[100,.12]],billboard='Billboard',blend='Blend',cutoff=[[0,0],[100,.7]],fade_in=0,fade_out=4),+ sprite('Collapse core','T_Smoke02',(8,2,18,245),life=8,delay=61,size=1.2,size_curve=[[0,1],[35,.85],[100,.12]],billboard='Billboard',blend='Blend',cutoff=dict(start=0,end=.7,easing='Linear'),fade_in=0,fade_out=4),glow('Release bloom',(150,60,255,140),4.0,life=18,delay=62),slice_line('Slice line',pale,10,width=.07,angle=-14,life=14,delay=62),slice_line('Cross line',(225,150,255,255),5.5,width=.045,angle=68,life=10,delay=64),# The release lies down on the disk plane as two torn strokes sweeping opposite ways, then goes out as grey smoke arcs.*release_wave,*[decay(arc,ash,lag=6,stretch=1.65) for arc in release_wave],- decal('Ground spiral','T_Vortex01',magenta,4.2,life=26,delay=62,spin=4,color_end=fade((110,90,120,255)),position=[.35,GROUND,.2],alpha_texture='T_NoiseTile01',cutoff=[[0,.2],[100,.65]],fade_in=0,fade_out=16,emissive=1.4),- decal('Spiral brand','T_Vortex01',(70,62,78,190),4.4,life=30,delay=68,spin=1.2,blend='Blend',position=[.35,GROUND+.01,.2],alpha_texture='T_NoiseTile01',cutoff=[[0,.15],[100,.6]],fade_in=4,fade_out=18),+ decal('Ground spiral','T_Vortex01',magenta,4.2,life=26,delay=62,spin=4,color_end=fade((110,90,120,255)),position=[.35,GROUND,.2],alpha_texture='T_NoiseTile01',cutoff=dict(start=.2,end=.65,easing='Linear'),fade_in=0,fade_out=16,emissive=1.4),+ decal('Spiral brand','T_Vortex01',(70,62,78,190),4.4,life=30,delay=68,spin=1.2,blend='Blend',position=[.35,GROUND+.01,.2],alpha_texture='T_NoiseTile01',cutoff=dict(start=.15,end=.6,easing='Linear'),fade_in=4,fade_out=18),# Complementary accent: a hot orange rim under the near side of the release, 5-10% of the frame.wisps('Ember rim',ember,2.1,count=1,width=.22,sweep=(100,265),life=16,delay=62,tilt=(-90,0,0),size=1,position=[0,GROUND+.05,0],broken=.12,emissive=1.6),distortion_ring('Release refraction',4.4,life=14,delay=62,strength=1.1),diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Fire_Explosion.py b/skills/effekseer-vfx/assets/examples/src/VFX_Fire_Explosion.pyindex 4ff9b33..778be79 100644--- a/skills/effekseer-vfx/assets/examples/src/VFX_Fire_Explosion.py+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Fire_Explosion.py@@ -28,11 +28,11 @@ def recipe():# Painted flipbook billows that cool as they roll, thrown off-centre along the shot so the ball is lopsided.billow('Fireball',[(0,(255,210,150,255)),(12,orange),(45,(235,65,10,240)),(75,(170,35,10,200)),(100,(60,10,5,0))],size=[1.6,3.4],life=[24,32],count=3,delay=6,interval=1,spawn=dict(shape='Sphere',radius=[.2,1.0]),position=[.35,0,0],velocity=[0,[.006,.02],0],spin=[0,0,[-.8,.8]],emissive=.85,- alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.12],[60,.42],[100,.8]],alpha_scroll=[.018,-.01],edge=dict(color=[255,80,15,255],threshold=.05,scaling=2)),+ alpha_texture='T_NoiseTile01',cutoff=dict(start=0,end=.8,easing='Linear'),alpha_scroll=[.018,-.01],edge=dict(color=[255,80,15,255],threshold=.05,scaling=2)),# A mushroom head that keeps climbing after the blast.billow('Mushroom',[(0,orange),(25,(235,80,20,240)),(70,(150,35,10,180)),(100,(50,15,8,0))],size=[1.6,2.2],life=[30,36],count=2,delay=12,interval=3,spawn=dict(shape='Sphere',radius=[0,.3],rotate=False),travel=dict(end=[[.3,.75],[1.6,2.1],[-.2,.2]],easing='EaseOutCubic'),emissive=.85,- alpha_texture='T_NoiseTile01',cutoff=[[0,0],[40,.08],[100,.6]],edge=dict(color=[255,80,15,255],threshold=.05,scaling=2)),+ alpha_texture='T_NoiseTile01',cutoff=dict(start=0,end=.6,easing='EaseInQuadratic'),edge=dict(color=[255,80,15,255],threshold=.05,scaling=2)),*ground_arcs,*[decay(arc,(90,78,70,170),lag=5,stretch=2.0) for arc in ground_arcs],distortion_ring('Refraction wave',3.8,life=16,delay=6,strength=1.0),heat_haze('Heat haze',4.2,life=50,delay=8,strength=.5),diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Ice_Spikes.py b/skills/effekseer-vfx/assets/examples/src/VFX_Ice_Spikes.pyindex dac87f5..7634903 100644--- a/skills/effekseer-vfx/assets/examples/src/VFX_Ice_Spikes.py+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Ice_Spikes.py@@ -12,13 +12,13 @@ def recipe():# Faceted crystal meshes that punch up through the frost: real silhouettes from any angle, not painted cards.def spikes(tag,height,radius,delay,**kw):return crystal(tag,(125,210,255,245),height,radius,40,edge=(190,235,255,230),delay=delay,scale_start=[1,1,1],scale_curve=grow,- alpha_texture='T_NoiseTile02',cutoff=[[0,0],[78,0],[100,.95]],fade_in=0,fade_out=4,emissive=.85) | dict(falloff=dict(begin=[155,215,255,235],end=[205,240,255,245],pow=.35,blend='Mul'),culling='Front') | kw+ alpha_texture='T_NoiseTile02',cutoff=dict(start=0,end=.95,easing='EaseInQuartic'),fade_in=0,fade_out=4,emissive=.85) | dict(falloff=dict(begin=[155,215,255,235],end=[205,240,255,245],pow=.35,blend='Mul'),culling='Front') | kw# Prism fringe on the cold wave: the same broken stroke in three hues, a few centimetres apart (ice's complementary accent).prism=[wisps(f'Cold wave {tag}',color,2.6,count=1,width=.25,sweep=(-30,230),life=14,delay=delay,tilt=(-90,0,0),size=1,position=[dx,.08,0],broken=.08,flow=-.06,texture='T_Trail02')for tag,color,dx,delay in [('R',(255,140,190,150),-.06,8),('G',(150,255,220,150),0,8),('B',(130,170,255,190),.06,9)]]return effect('Ice_Spikes','Ice Spikes','element','ice',1.35,[# Frost: a torn, uneven patch with bright cracks running through it, not a clean disc.- decal('Frost creep','T_Smoke02',cyan,4.2,life=60,size_curve=[[0,.1],[12,.8],[30,1],[100,1.03]],color_end=fade(deep),cutoff=[[0,.05],[100,.5]],fade_in=0,fade_out=30,angle=60),+ decal('Frost creep','T_Smoke02',cyan,4.2,life=60,size_curve=[[0,.1],[12,.8],[30,1],[100,1.03]],color_end=fade(deep),cutoff=dict(start=.05,end=.5,easing='Linear'),fade_in=0,fade_out=30,angle=60),decal('Frost cracks','T_Crack01',(200,240,255,220),4.0,life=58,delay=3,size_curve=[[0,.3],[14,1],[100,1.02]],color_end=fade(deep),fade_in=0,fade_out=26,emissive=1.3,angle=25),decal('Frost glow','T_Glow01',(60,150,255,130),4.6,life=55,delay=2),# A tight core cluster leaning apart, a scatter of uneven crystals round it, and a ripple of crystals erupting indiff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Poison_Cloud.py b/skills/effekseer-vfx/assets/examples/src/VFX_Poison_Cloud.pyindex 4cde1f2..d0d6cc4 100644--- a/skills/effekseer-vfx/assets/examples/src/VFX_Poison_Cloud.py+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Poison_Cloud.py@@ -13,19 +13,19 @@ def recipe():# Ground: an uneven acid pool spreads under the target, rim glowing, and bubbles keep breaking out of it.# An irregular painted puff laid flat is a ragged puddle; a soft circle reads as a clean disc however it is eroded.decal('Acid pool','T_Smoke02',(55,120,28,210),4.6,life=101,delay=3,blend='Blend',position=[.1,GROUND+.02,0],size_curve=[[0,.2],[12,.85],[100,1.05]],- cutoff=[[0,.05],[100,.5]],fade_in=0,fade_out=34,angle=20),+ cutoff=dict(start=.05,end=.5,easing='Linear'),fade_in=0,fade_out=34,angle=20),decal('Pool sheen','T_Smoke02',(160,255,70,120),3.6,life=80,delay=4,position=[.2,GROUND+.03,.1],size_curve=[[0,.2],[12,.85],[100,1.05]],- cutoff=[[0,.25],[100,.8]],fade_in=0,fade_out=30,emissive=1.3,angle=140),+ cutoff=dict(start=.25,end=.8,easing='Linear'),fade_in=0,fade_out=30,emissive=1.3,angle=140),sprite('Acid glints','T_Star01',(245,255,220,255),count=10,interval=8,delay=6,life=[8,12],size=.3,size_curve=[[0,.2],[30,1],[100,0]],rotation=[0,0,[0,90]],position=[[-.9,1.5],[GROUND+.1,GROUND+.5],[-.8,.8]],fade_in=0,fade_out=3,emissive=2.0),# Splash: a white-hot acid flash and three broken strokes thrown at random tilts.# Contact is a ragged acid splat, not the shared four-point flare.- sprite('Splash shadow','T_Explosion01',(65,22,78,240),life=10,delay=0,size=1.65,size_curve=[[0,1],[30,1.05],[100,1.15]],position=[0,-.12,0],rotation=[0,0,25],blend='Blend',cutoff=[[0,0],[100,.75]],fade_in=0,fade_out=5),+ sprite('Splash shadow','T_Explosion01',(65,22,78,240),life=10,delay=0,size=1.65,size_curve=[[0,1],[30,1.05],[100,1.15]],position=[0,-.12,0],rotation=[0,0,25],blend='Blend',cutoff=dict(start=0,end=.75,easing='Linear'),fade_in=0,fade_out=5),glow('Splash core',(245,255,225,255),.32,life=3,delay=1,fade_out=2,emissive=1.8),sprite('Splash flash','T_Explosion01',(215,255,130,255),life=3,delay=1,size=.9,size_curve=[[0,.5],[30,1],[100,1.15]],rotation=[0,0,25],fade_in=0,fade_out=2,emissive=2.0),wisps('Splash strokes',acid,1.0,count=3,width=.3,sweep=(0,120),life=10,delay=1,size=(.8,1.2),emissive=1.6),sprite('Burst puff','T_Explosion01',(105,190,45,255),color_end=dark,count=2,delay=1,life=[18,24],size=[.65,.9],size_end=[1.0,1.3],easing='EaseOutQuartic',blend='Blend',- spawn=dict(shape='Sphere',radius=[.1,.3]),rotation=[0,0,[-180,180]],alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.1],[100,.9]],fade_in=0,fade_out=5),+ spawn=dict(shape='Sphere',radius=[.1,.3]),rotation=[0,0,[-180,180]],alpha_texture='T_NoiseTile01',cutoff=dict(start=0,end=.9,easing='EaseInQuadratic'),fade_in=0,fade_out=5),glow('Sick glow',(140,255,60,45),1.8,life=50,size_curve=[[0,.3],[10,1],[100,1.1]],fade_in=2,fade_out=30),# Value structure: a bruised purple underside first, then fumes that cool from acid yellow-green to murky green# to purple-grey, piled low and downwind (+X) instead of a round ball.diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Dark.py b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Dark.pyindex 04567ce..cad0624 100644--- a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Dark.py+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Dark.py@@ -21,7 +21,7 @@ def recipe():travel=dict(end=[0,[-1.15,-.9],0],easing='EaseInCubic'),fade_in=2,fade_out=2,emissive=2.2),1),sustain(distortion_ring('Lens',.8,life=6,strength=1.4,fade_in=1,fade_out=3),3),# The orb's body is churning black smoke rather than a clean disc: its silhouette tears and boils every frame.- sustain(sprite('Seed core','T_Smoke02',(6,1,16,245),life=7,size=.85,size_end=.5,blend='Blend',billboard='Billboard',cutoff=[[0,0],[100,.65]],fade_in=0,fade_out=3),3),+ sustain(sprite('Seed core','T_Smoke02',(6,1,16,245),life=7,size=.85,size_end=.5,blend='Blend',billboard='Billboard',cutoff=dict(start=0,end=.65,easing='Linear'),fade_in=0,fade_out=3),3),sustain(smoke('Churn core',(4,0,10,250),size=(.85,1.05),grow=.85,life=(7,9),speed=(0,0),rise=0,radius=(0,.07),fade_in=0,fade_out=4),1),# Grey-violet dust visibly dragged into the orb from all sides.sustain(motes('Drawn dust',1,(190,170,210,255),color_end=(120,60,200,255),size=(.06,.11),life=(12,16),spawn=dict(shape='Sphere',radius=[1.1,1.5]),diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Fire.py b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Fire.pyindex ab5cb34..387cee9 100644--- a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Fire.py+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Fire.py@@ -16,7 +16,7 @@ def recipe():sustain(sprite('Flame trail','T_ExplosionSheet01',**ramp((0,(255,220,140,255)),(25,orange),(60,(200,55,15,200)),(100,(90,28,12,0))),life=[18,26],size=[.45,.95],size_end=[.15,.3],easing='EaseInQuadratic',rotation=[0,0,[-180,180]],flipbook=dict(x=4,y=4,frame_length=2,loop='Once',start=[3,7]),spawn=dict(shape='Sphere',radius=[0,.12],rotate=False),travel=dict(end=[0,[.45,.8],0],easing='EaseOutCubic'),inherit=TRAIL,- alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.08],[100,.8]],edge=dict(color=[255,90,20,255],threshold=.06,scaling=2),fade_in=0,fade_out=6),1.5),+ alpha_texture='T_NoiseTile01',cutoff=dict(start=0,end=.8,easing='EaseInQuadratic'),edge=dict(color=[255,90,20,255],threshold=.06,scaling=2),fade_in=0,fade_out=6),1.5),# Broken flame strokes wrapping the ball at a new tilt every emission: it churns instead of reading as a disc.sustain(wisps('Flame wisps',(255,130,40,255),.6,count=1,width=.22,sweep=(0,150),life=8,flow=-.1,emissive=1.1),2),sustain(motes('Embers',1,orange,color_end=red,size=(.05,.11),life=(18,28),distance=(.1,.45),radius=(0,.15),rise=.0006,turbulence=.001,inherit=TRAIL,spawn=dict(shape='Sphere',radius=[0,.08],rotate=False),travel=dict(end=[[-.7,-.3],[.35,.65],[-.2,.2]],easing='EaseOutCubic')),2.5),@@ -28,7 +28,7 @@ def recipe():# Comet: a looping flame flipbook laid along the flight, tongues streaming back behind the boiling ball.# Comet tail: the same turbulent flipbook stretched back along the flight, so the head reads as a teardrop.sustain(sprite('Comet tail','T_ExplosionSheet01',(255,150,50,255),color_end=(255,80,20,255),life=6,scale_start=[[1.5,1.8],[.6,.75],1],rotation=[0,0,[-10,10]],position=[-.75,0,0],- flipbook=dict(x=4,y=4,frame_length=1,loop='Once',start=[3,8]),alpha_texture='T_NoiseTile01',cutoff=[[0,.05],[100,.4]],+ flipbook=dict(x=4,y=4,frame_length=1,loop='Once',start=[3,8]),alpha_texture='T_NoiseTile01',cutoff=dict(start=.05,end=.4,easing='Linear'),fade_in=1,fade_out=3,emissive=.85),2),# Each head sprite plays a few dense frames of the explosion sheet from a random start, so the ball boils.sustain(sprite('Fireball','T_ExplosionSheet01',(255,170,60,255),color_end=(255,90,20,255),life=[5,7],scale_start=[[1.15,1.35],[.75,.9],1],rotation=[0,0,[-25,25]],spin=[0,0,[-3,3]],diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Shield_Dome.py b/skills/effekseer-vfx/assets/examples/src/VFX_Shield_Dome.pyindex 7ac2caf..7cc5960 100644--- a/skills/effekseer-vfx/assets/examples/src/VFX_Shield_Dome.py+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Shield_Dome.py@@ -12,17 +12,18 @@ def recipe():return effect('Shield_Dome','Shield Dome','status','arcane',1.8,[flash('Raise glint',WHITE,3.6,life=5,position=[0,.4,1.2]),# Clean fresnel force field (a colour texture or a held dissolve edge rendered as grey blotches in the plugin);- # On expiry the full shell hands off to partial spherical geometry; cutoff alone did not open visible holes.+ # On expiry the full shell hands off to partial spherical geometry: the readable break-up (the shell's own cutoff once+ # never animated in Godot because it was an FCurve; it now compiles to an Easing, see engine conventions).mesh('Shell','Sphere',(50,120,255,170),life=84,radius=1,sides=48,rings=24,scale_start=[1.45]*3,scale_curve=pop,culling='Front',z_test=True,falloff=dict(begin=[60,120,255,90],end=[150,210,255,255],pow=.6,blend='Mul'),alpha_texture='T_NoiseTile02',alpha_scroll=[.002,.003],- cutoff=[[0,0],[84,0],[90,.25],[96,.6],[100,.98]],fade_in=2,fade_out=4),+ cutoff=dict(start=0,end=.98,easing='EaseInQuartic'),fade_in=2,fade_out=4),# Falloff: begin covers the part facing the camera and a higher pow shrinks it, so a thin rim needs pow < 1.mesh('Rim','Sphere',(150,200,255,200),life=84,radius=1,sides=48,rings=24,scale_start=[1.47]*3,scale_curve=pop,culling='Front',z_test=True,falloff=dict(begin=[0,0,0,0],end=[255,255,255,255],pow=.4,blend='Mul'),alpha_texture='T_NoiseTile02',- cutoff=[[0,0],[84,0],[90,.25],[96,.6],[100,.98]],fade_in=2,fade_out=4),+ cutoff=dict(start=0,end=.98,easing='EaseInQuartic'),fade_in=2,fade_out=4),# Energy streaks crawling over the surface: a streak mask flowing round the sphere (multiplied, no cutoff edge).mesh('Surface flow','Sphere',(110,190,255,170),life=80,radius=1,sides=48,rings=24,scale_start=[1.46]*3,scale_curve=pop,culling='Front',z_test=True,delay=4,- alpha_texture='T_NoiseStreak01',alpha_scroll=[.012,.004],cutoff=[[0,0],[82,0],[90,.3],[100,.98]],+ alpha_texture='T_NoiseStreak01',alpha_scroll=[.012,.004],cutoff=dict(start=0,end=.98,easing='EaseInQuartic'),falloff=dict(begin=[0,0,0,0],end=[255,255,255,255],pow=.8,blend='Mul'),fade_in=8,fade_out=4,emissive=1.4),shock_ring('Equator pulse',pale,1.9,life=14,delay=3,ground=True,thickness=.18),shock_ring('Scan bands',blue,1.5,life=30,delay=14,ground=True,count=3,interval=22,travel=dict(start=[0,-1.1,0],end=[0,1.2,0],easing='Linear'),thickness=.08,size_curve=[[0,.65],[50,1],[100,.6]]),diff --git a/skills/effekseer-vfx/references/cases.md b/skills/effekseer-vfx/references/cases.mdindex 0c31b55..b4a35de 100644--- a/skills/effekseer-vfx/references/cases.md+++ b/skills/effekseer-vfx/references/cases.md@@ -71,6 +71,9 @@ In the original iterations the geometric gaps worked first, but large fragmentsindependent review still said iterate; a further round adjusted fragment life and RGB decay to finish the exit.Adding a new shape does not excuse the last frame. This failure shows only that this shell material combinationdoes not erode visibly — not that Model layers never support alpha cutoff — and the fix kept the official renderer.+Later measurement found the cause: in the Godot runtime an FCurve cutoff threshold never leaves its first key, so no+cutoff curve eroded anything (see [engine conventions](engine-conventions.md)). Cutoffs now compile to Easings; the+fragments remain the readable break-up.## Using a casediff --git a/skills/effekseer-vfx/references/engine-conventions.md b/skills/effekseer-vfx/references/engine-conventions.mdindex 5cc01d3..fd7b001 100644--- a/skills/effekseer-vfx/references/engine-conventions.md+++ b/skills/effekseer-vfx/references/engine-conventions.md@@ -66,6 +66,14 @@ lifetime · rendering, HDR and the Lab · anchors and placement · extending the- **UV distortion textures must be opaque RG offset maps** (`T_Distort01/02`). A white-on-alpha mask used as adistortion map distorts nothing.- **Alpha textures read the alpha channel**; every `T_Noise*` mask works directly for a `cutoff` dissolve.+- **Dissolve thresholds animate only as an Easing.** Measured in Godot renders (EffekseerForGodot4 1.80.5.1, Lab and a+ Mobile-renderer game): with `AlphaCutoffParam/Type = FCurve` (Percent or Time timeline) the threshold stays at its+ first key for the whole life, so the shape never erodes; with `Type = Easing` it animates, and the easing type+ (`Linear`, `EaseInQuadratic`, `EaseInCubic`, `EaseInQuartic`, `EaseInQuintic`, `EaseOut*`) shapes it. Core clamps+ the start and end thresholds to 0..1, so a hold-then-erode dissolve is an ease-in, not a negative start. The+ compiler always writes an Easing: `cutoff=dict(start=a, end=b, easing='EaseInQuadratic')` for exact control, or a+ curve `[[percent, value], ...]`, which it fits with the closest easing (`cutoff_easing`). Read-back alone does not+ show this; look at the strip.- **Flipbook integers**: `flipbook.frame_length`, `x` and `y` are integer Core properties and must be positive integers(4.5 is rejected natively; the field validator catches it first). Lengthen playback with integer frame lengthsand life together.diff --git a/skills/effekseer-vfx/references/primitives.md b/skills/effekseer-vfx/references/primitives.mdindex 633b2de..9bbad42 100644--- a/skills/effekseer-vfx/references/primitives.md+++ b/skills/effekseer-vfx/references/primitives.md@@ -66,7 +66,7 @@ nature: contact stars, glows, sparks and smoke puffs (stacked into volume).|---|---|| `ramp((0,c0),(30,c1),(100,c2))` | colour over life as 3–5 stops → `color_curve` (a two-colour lerp reads as a tint) || `fade(color, alpha=0)` | same RGB, new alpha |-| `POP`, `DISSOLVE` | scale curve that snaps then drifts; cutoff curve that holds then erodes |+| `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 || `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) |@@ -87,5 +87,8 @@ save/open read-back test, not written as raw property paths in a recipe (procedu## UnitsLayer `life`, `delay`, `interval`: 60 FPS frames. Velocity and acceleration: units per frame; gravity: units per frame².-Angles: degrees. Colours: RGBA 0–255. Curves (`size_curve`, `cutoff`, `color_curve`...): `[[percent_of_life, value], ...]`.+Angles: degrees. Colours: RGBA 0–255. Curves (`size_curve`, `color_curve`...): `[[percent_of_life, value], ...]`.+`cutoff` (dissolve threshold, 0..1): a number (fixed), `dict(start=a, end=b, easing='Linear')` (over the particle's life;+`EaseIn*` holds the shape first), or a curve, which the compiler fits to the closest easing — an FCurve threshold does+not animate in Godot (see [engine conventions](engine-conventions.md)).Manifest `duration` and `peak`: seconds. Random ranges are `[min, max]`.diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py b/skills/effekseer-vfx/scripts/effekseer_ai/authoring.pyindex 46f60ea..8fda8cc 100644--- a/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py+++ b/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py@@ -23,6 +23,7 @@ NESTED_FIELDS={'flipbook':{'x','y','frame_length','loop','start','lerp'},'inherit':{'location','rotation','scale','color'},'collide':{'height','bounce','friction','reduction','world'},+ 'cutoff':{'start','end','easing'},}FORCE_FIELDS={'type','power','gravity','scale','octave','kind','control','min_range','max_range','position','rotation'}@@ -55,6 +56,32 @@ def validate_layer(spec,where='',recursive=True):for child in spec.get('children') or []:errors+=validate_layer(child,here)return errors+CUTOFF_EASINGS={'Linear':lambda t:t,'EaseInQuadratic':lambda t:t**2,'EaseInCubic':lambda t:t**3,'EaseInQuartic':lambda t:t**4,+ 'EaseOutQuadratic':lambda t:1-(1-t)**2,'EaseOutCubic':lambda t:1-(1-t)**3}++def cutoff_easing(curve):+ """{'start','end','easing'} equivalent of a cutoff curve [[percent_of_life, threshold], ...].++ Thresholds are written as an Easing because the Godot runtime keeps an FCurve threshold at its first key. Core+ clamps the values to 0..1, so the curve's shape goes into the easing type: start is the first key, end the curve+ extended to 100 %, and the easing type is the one that fits the keys best (a curve that holds and then erodes+ becomes an ease-in). Write the dict yourself for exact control.+ """+ keys=sorted((float(f),float(v)) for f,v in curve)+ if not keys:raise ValueError('cutoff curve needs at least one key')+ clamp=lambda v:round(min(1.0,max(0.0,v)),4)+ start=clamp(keys[0][1])+ if len(keys)==1:return {'start':start,'end':start,'easing':'Linear'}+ (f0,v0),(f1,v1)=keys[-2],keys[-1]+ end=clamp(v1+(v1-v0)/max(f1-f0,1e-6)*(100-f1))+ def at(t):+ for (a,va),(b,vb) in zip(keys,keys[1:]):+ if t<=b:return va+(vb-va)*(t-a)/max(b-a,1e-6) if t>=a else va+ return vb+(v1-v0)/max(f1-f0,1e-6)*(t-keys[-1][0])+ samples=[at(t) for t in range(0,101,5)]+ error=lambda f:sum((start+(end-start)*f(t/100)-v)**2 for t,v in zip(range(0,101,5),samples))+ return {'start':start,'end':end,'easing':min(CUTOFF_EASINGS,key=lambda name:error(CUTOFF_EASINGS[name]))}+def layer_schema():"""Field names accepted by layer specs, for agents that want to check a recipe before compiling."""return {'layer':sorted(LAYER_FIELDS),**{k:sorted(v) for k,v in NESTED_FIELDS.items()},'forces':sorted(FORCE_FIELDS)}@@ -129,7 +156,12 @@ class LayerBuilder:C=A+'AlphaCutoffParam/'; s(n,C+'Enabled',True)if isinstance(cutoff,(int,float)):s(n,C+'Type','Fixed'); s(n,C+'Fixed/Threshold',cutoff)else:- s(n,C+'Type','FCurve'); s(n,C+'FCurve/Timeline','Percent'); self.curve(n,C+'FCurve/S',cutoff)+ # The threshold is always written as an Easing over the particle's life: the Godot runtime+ # (EffekseerForGodot4 1.80.5.1) keeps an FCurve threshold at its first key, so a curve never erodes there.+ # Core clamps the thresholds to 0..1; a hold-then-erode shape comes from an ease-in curve, not a negative start.+ ease=cutoff if isinstance(cutoff,dict) else cutoff_easing(cutoff)+ s(n,C+'Type','Easing'); r(n,C+'Easing/Start',ease['start']); r(n,C+'Easing/End',ease['end'])+ s(n,C+'Easing/Type',ease.get('easing','Linear'))edge=spec.get('edge')if edge:self.color(n,C+'EdgeParam/EdgeColor',edge['color']); s(n,C+'EdgeParam/EdgeThreshold',edge.get('threshold',.1)); s(n,C+'EdgeParam/EdgeColorScaling',edge.get('scaling',2))diff --git a/skills/effekseer-vfx/scripts/vfxkit/primitives.py b/skills/effekseer-vfx/scripts/vfxkit/primitives.pyindex 0ee2ffe..c127904 100644--- a/skills/effekseer-vfx/scripts/vfxkit/primitives.py+++ b/skills/effekseer-vfx/scripts/vfxkit/primitives.py@@ -85,7 +85,7 @@ def slash_arc(name,color,radius=1.5,width=.55,sweep=(-20,200),life=11,delay=0,tireturn dict(name=name,renderer='Ring',texture=tex(texture),color=list(color),life=life,delay=delay,billboard='Fixed',rotation=list(tilt),ring=dict(vertices=96,outer=[radius,depth],inner=dict(start=[radius-width,-depth*.6],end=[radius-width*.25,-depth*.15]),center_ratio=.6,outer_color=list(color),center_color=list(color),inner_color=list(color),angle_start=[a0,a0+(a1-a0)*.4],angle_end=[a0+(a1-a0)*.12,a1],angle_easing='EaseOutQuartic',angle_fade=[25,4]),- alpha_texture=tex('T_NoiseStreak01'),cutoff=[[0,0],[35,.05],[100,.75]],fade_in=0,fade_out=life*.5,wrap='Clamp',**extra) | kw+ alpha_texture=tex('T_NoiseStreak01'),cutoff=dict(start=0,end=.75,easing='EaseInQuadratic'),fade_in=0,fade_out=life*.5,wrap='Clamp',**extra) | kwdef wisps(name,color,radius,count=4,width=.3,sweep=(0,150),life=(14,22),delay=0,interval=0,tilt=((-90,90),(0,360),(0,360)),size=(.7,1.3),flow=-.05,broken=.1,texture='T_WispTrail01',**kw):@@ -96,7 +96,7 @@ def wisps(name,color,radius,count=4,width=.3,sweep=(0,150),life=(14,22),delay=0,billboard='Fixed',rotation=[list(t) if isinstance(t,(list,tuple)) else t for t in tilt],size=list(size) if isinstance(size,(list,tuple)) else size,ring=dict(vertices=72,outer=[radius,0],inner=dict(start=[radius-width,0],end=[radius-width*.3,0]),center_ratio=.45,outer_color=fade(color,color[3]//3),center_color=list(color),inner_color=fade(color),angle_start=[a0,a0+(a1-a0)*.5],angle_end=[a0+(a1-a0)*.2,a1],angle_easing='EaseOutCubic',angle_fade=[20,6]),- alpha_texture=tex('T_NoiseStreak01'),alpha_scroll=[flow,0],cutoff=[[0,broken],[45,broken+.08],[100,.8]],fade_in=1,fade_out=peak*.45,wrap='Clamp',emissive=2.0) | kw+ alpha_texture=tex('T_NoiseStreak01'),alpha_scroll=[flow,0],cutoff=dict(start=broken,end=.8,easing='EaseInQuadratic'),fade_in=1,fade_out=peak*.45,wrap='Clamp',emissive=2.0) | kwdef decay(layer,color,lag=6,stretch=2.2,name=None):"""Emissive-to-smoke afterimage: the same stroke, alpha-blended grey, a few frames late and much longer lived, so the@@ -139,7 +139,7 @@ def smoke(name,color,count=5,size=(.5,.9),grow=1.9,life=(30,48),delay=0,interval"""Alpha-blended puffs that grow and slow down. The default painted flipbook billows, curls and tears itselfapart over life (a single still puff only scales), so the noise dissolve is light; still textures erode harder."""sheet=texture.endswith('Sheet01')- extra=dict(flipbook=dict(x=4,y=4,frame_length=max(1,round(max(life)/16)),loop='Once'),cutoff=[[0,0],[60,.04],[100,.3]]) if sheet else dict(cutoff=[[0,0],[40,.1],[100,.7]])+ 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]],size=list(size),size_end=[size[0]*grow,size[1]*grow],easing='EaseOutCubic',forces=[dict(type='Gravity',gravity=[0,rise,0])],@@ -155,7 +155,7 @@ def flame(name,color,color_end,size,life,count=1,**kw):billboard='YAxisFixed',pivot='bottom',flipbook=dict(x=4,y=4,frame_length=max(1,round(peak/16)),loop='Once'),# No UV distortion: on a 4x4 sheet it is measured in whole-texture UV, so .12 shifts half a cell and samples the# neighbouring frames, cutting the fire into hard-edged blocks.- alpha_texture='T_NoiseTile01',cutoff=[[0,.04],[40,.14],[100,.75]],edge=dict(color=[255,90,20,255],threshold=.06,scaling=2),+ alpha_texture='T_NoiseTile01',cutoff=dict(start=.04,end=.5,easing='EaseInQuintic'),edge=dict(color=[255,90,20,255],threshold=.06,scaling=2),fade_in=1,fade_out=8,emissive=1.5) | kwdef ramp(*stops):@@ -182,7 +182,10 @@ def distortion_ring(name,radius,life=14,delay=0,strength=1.0,ground=False,**kw):def decal(name,texture,color,size,life,delay=0,spin=0,**kw):"""Flat ground-plane sprite (rune, crack, scorch); depth-tested so characters stand on top of it."""- return sprite(name,texture,color,life=life,delay=delay,billboard='Fixed',rotation=[-90,0,kw.pop('angle',0)],spin=[0,0,spin],position=[0,.05,0],size=size,z_test=True,fade_in=kw.pop('fade_in',4),fade_out=kw.pop('fade_out',life*.4)) | kw+ # Extra fields go through sprite() so texture names (alpha_texture, ...) resolve to files like every other layer.+ base=dict(billboard='Fixed',rotation=[-90,0,kw.pop('angle',0)],spin=[0,0,spin],position=[0,.05,0],z_test=True,+ fade_in=kw.pop('fade_in',4),fade_out=kw.pop('fade_out',life*.4))+ return sprite(name,texture,color,life=life,delay=delay,size=size,**(base|kw))def standing(name,texture,color,size,life,delay=0,**kw):"""Upright camera-facing sprite that grows from its base."""@@ -215,7 +218,7 @@ def shell(name,color,radius,life=14,delay=0,pow=.35,**kw):volume from any angle where a camera-facing ring reads as a flat hoop."""# Front faces only: with both sides drawn, the inner back faces also read as 'edge' and fill the bubble in.return mesh(name,'Sphere',color,life,radius=1,sides=48,rings=24,scale_start=[radius]*3,scale_curve=[[0,.15],[35,.75],[100,1]],culling='Front',delay=delay,- falloff=dict(begin=[0,0,0,0],end=[255,255,255,255],pow=pow,blend='Mul'),alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.08],[100,.75]],+ falloff=dict(begin=[0,0,0,0],end=[255,255,255,255],pow=pow,blend='Mul'),alpha_texture='T_NoiseTile01',cutoff=dict(start=0,end=.75,easing='EaseInQuadratic'),fade_in=0,fade_out=life*.7) | kw # the rim tears open as it expands instead of fading as one balloondef shell_fragments(name,color,radius,delay=80,life=28):@@ -277,7 +280,10 @@ def budget(layer):# ---------------------------------------------------------------- recipe helpersPOP=[[0,.4],[18,1],[100,1.1]] # snap to size, then drift-DISSOLVE=[[0,0],[40,.06],[100,.9]] # hold solid, then erode through the alpha texture+# Hold solid, then erode through the alpha texture. Dissolve thresholds are Easings over the particle's life (an FCurve+# threshold does not animate in the Godot runtime, and Core clamps thresholds to 0..1): the ease-in keeps the shape+# 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')# Trail layers keep the world position they were born at, so a moving projectile leaves them behind.diff --git a/tests/test_pipeline.py b/tests/test_pipeline.pyindex 8c92761..d1b16f7 100644--- a/tests/test_pipeline.py+++ b/tests/test_pipeline.py@@ -132,8 +132,11 @@ def test_advanced_layer_features_survive_core_roundtrip(tmp_path):arc, sparks, shell, spike, haze = [f'node/root/{i}' for i in range(5)]assert s.property_get(arc + '/DrawingValues/Ring/RingShape/Type/Value') == 'Crescent'assert s.property_get(arc + '/DrawingValues/Ring/RingShape/Crescent/EndingAngle_Easing/End/Max') == 200- assert s.property_get(arc + '/AdvancedRendererCommonValuesValues/AlphaCutoffParam/Type/Value') == 'FCurve'- assert len(s.curve_keys(arc + '/AdvancedRendererCommonValuesValues/AlphaCutoffParam/FCurve/S')) == 2+ # A cutoff curve compiles to an Easing threshold (an FCurve threshold does not animate in the Godot runtime).+ cut = arc + '/AdvancedRendererCommonValuesValues/AlphaCutoffParam/'+ assert s.property_get(cut + 'Type/Value') == 'Easing'+ assert s.property_get(cut + 'Easing/Type/Value') == 'Linear'+ assert s.property_get(cut + 'Easing/Start/Max') == 0 and s.property_get(cut + 'Easing/End/Max') == pytest.approx(.8)assert s.property_get(sparks + '/GenerationLocationValues/Type/Value') == 'Sphere'assert s.property_get(sparks + '/LocationValues/Type/Value') == 'Easing'assert s.property_get(sparks + '/LocationValues/Easing/End/Y/Max') == 2@@ -279,7 +282,7 @@ def test_reference_primitives_break_shapes_and_decay_to_smoke():arcs = wisps('w', (200, 100, 255, 255), 1.2, count=4, life=(14, 22), tilt=((-90, 90), (0, 360), (0, 360)))# Each stroke takes its own tilt and size, and the erosion starts above zero so no arc is ever a clean ring.assert arcs['renderer'] == 'Ring' and isinstance(arcs['rotation'][0], list) and isinstance(arcs['size'], list)- assert arcs['cutoff'][0][1] > 0 and arcs['ring']['angle_start'] != arcs['ring']['angle_end']+ assert arcs['cutoff']['start'] > 0 and arcs['ring']['angle_start'] != arcs['ring']['angle_end']smoke = decay(arcs | {'delay': 5, 'emissive': 2}, (110, 100, 120, 170), lag=6, stretch=2)assert smoke['blend'] == 'Blend' and smoke['delay'] == 11 and smoke['life'] == [28, 44] and 'emissive' not in smokeassert smoke['ring']['center_color'] == [110, 100, 120, 170] and smoke['alpha_scroll'][0] == arcs['alpha_scroll'][0] * .4@@ -360,3 +363,49 @@ def test_scaffold_syncs_character_models(tmp_path):(models / 'player.glb').write_bytes(b'glTF v2')initialize(tmp_path, install_plugin=False)assert copy.read_bytes() == b'glTF v2'+++def test_cutoff_curves_become_easings_that_keep_hold_and_tear():+ from effekseer_ai.authoring import cutoff_easing, validate_layer+ # Hold, then erode: an ease-in from 0 (Core clamps thresholds to 0..1, so a negative start cannot hold).+ assert cutoff_easing([[0, 0], [40, .06], [100, .9]]) == {'start': 0, 'end': .9, 'easing': 'EaseInQuadratic'}+ assert cutoff_easing([[0, 0], [84, 0], [90, .25], [96, .6], [100, .98]])['easing'] == 'EaseInQuartic'+ # A shape that is already torn at birth keeps its starting threshold; a straight ramp stays linear.+ assert cutoff_easing([[0, .1], [45, .18], [100, .8]])['start'] == .1+ assert cutoff_easing([[0, .05], [100, .5]]) == {'start': .05, 'end': .5, 'easing': 'Linear'}+ # A final key before 100 % is extrapolated to the end of life and clamped to 1.+ assert cutoff_easing([[0, 0], [50, .6]]) == {'start': 0, 'end': 1.0, 'easing': 'Linear'}+ assert cutoff_easing([[0, .3]]) == {'start': .3, 'end': .3, 'easing': 'Linear'}+ assert validate_layer({'name': 'x', 'cutoff': {'start': 0, 'end': .5, 'easing': 'EaseInCubic'}}) == []+ assert any('unknown field' in e for e in validate_layer({'name': 'x', 'cutoff': {'begin': 0, 'end': .5}}))+++@requires_core+def test_easing_cutoff_survives_core_roundtrip(tmp_path):+ from effekseer_ai.authoring import compile_effect+ from effekseer_ai.session import EffectSession+ tex = tmp_path / 'mask.png'+ Image.new('RGBA', (64, 64), (255, 255, 255, 200)).save(tex)+ recipe = {'duration': 1, 'layers': [+ {'name': 'burn', 'texture': str(tex), 'alpha_texture': str(tex), 'life': 30,+ 'cutoff': {'start': .1, 'end': [.7, .9], 'easing': 'EaseInCubic'}, 'edge': {'color': [255, 150, 60, 255], 'threshold': .05}},+ {'name': 'curve', 'texture': str(tex), 'alpha_texture': str(tex), 'life': 30, 'cutoff': [[0, 0], [40, .06], [100, .9]]}]}+ compile_effect(recipe, tmp_path / 'burn.efkefc', tmp_path / 'burn.efk')+ s = EffectSession.open(tmp_path / 'burn.efkefc')+ cut = 'node/root/0/AdvancedRendererCommonValuesValues/AlphaCutoffParam/'+ assert s.property_get(cut + 'Enabled/Value') is True and s.property_get(cut + 'Type/Value') == 'Easing'+ assert s.property_get(cut + 'Easing/Type/Value') == 'EaseInCubic'+ assert s.property_get(cut + 'Easing/Start/Min') == pytest.approx(.1) and s.property_get(cut + 'Easing/Start/Max') == pytest.approx(.1)+ assert s.property_get(cut + 'Easing/End/Min') == pytest.approx(.7) and s.property_get(cut + 'Easing/End/Max') == pytest.approx(.9)+ # A cutoff curve compiles to its fitted easing instead of an FCurve.+ cut = 'node/root/1/AdvancedRendererCommonValuesValues/AlphaCutoffParam/'+ assert s.property_get(cut + 'Type/Value') == 'Easing' and s.property_get(cut + 'Easing/Type/Value') == 'EaseInQuadratic'+ assert s.property_get(cut + 'Easing/End/Max') == pytest.approx(.9)+++def test_decal_resolves_extra_textures_and_accepts_overrides():+ from vfxkit.primitives import decal, DISSOLVE+ seal = decal('seal', 'T_Ring01', (255, 255, 255, 255), 2, 30, alpha_texture='T_NoiseTile01', cutoff=DISSOLVE, emissive=1.4, position=[0, .2, 0])+ # Extra texture fields resolve to files like every other layer; unresolved names were silently dropped by the compiler.+ assert seal['alpha_texture'].endswith('T_NoiseTile01.png') and Path(seal['alpha_texture']).is_absolute()+ assert seal['emissive'] == 1.4 and seal['position'] == [0, .2, 0] and seal['billboard'] == 'Fixed' and seal['z_test'] is True