Skip to content

Fx reboot, WIP - #299

Draft
trethaller wants to merge 172 commits into
masterfrom
fx-reboot
Draft

trethaller wants to merge 172 commits into
masterfrom
fx-reboot

Conversation

@trethaller

Copy link
Copy Markdown
Contributor

No description provided.

ncannasse and others added 30 commits October 9, 2026 17:49
vLerp folds into the existing flat values when it matches one of them
(the usual cases evaluate exactly as before), and falls back to VLerp,
which getFast evaluates, instead of a non flat VAdd/VMult.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Params are stored under their plain name (scale, startSpeed...), one mode
per component: Constant, Range, Curve, RandomCurve, CurveRange or unset,
the shapes being a curve referenced by path or an easing (EmitterParam).
Particle shaders under an emitter get the same model (Shader.particleParams),
colors keep their curves.

Old files are upgraded on load into equivalent modes (EmitterUpgrade) and
saved in the new format (props.paramsVersion). Upgraded emitters keep the
random slot layout of the old code (skippedRandomSlots), so they draw the
same randoms. The animation curves of the spawn and multiplier params, and
of the emitter settings, keep multiplying the value by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nes on load

An animation curve (over the FX time) is now the value of the property: the
object transforms (position, scale, rotation in degrees) of FX and FX2D, the
local rotation offset (degrees), the shader params out of the emitters, the
emitter settings, spawn params (value, min, max) and multipliers. The life
time can be animated too.

The emitter params reference their animation curves by path (Emitter /
Emitter2D.animCurves, saved in props.animCurves), curve names carry no meaning
there. The FX objects and shaders still find theirs by name.

Curves are saved with a version; the ones without it are upgraded on load
(AnimUpgrade, old format only), on the raw data from FX.load / FX2D.load and
the emitter load: the old constants are baked into the keys (exact for the
linear cases, a Reference curve takes them in its scale / offset, a Blend
curve bakes its children, the curves referencing a baked one are
compensated), the old emitter curves are bound by path where they are (a
range gets a second curve referencing the first). The rotation / scale of an
object composed with a base rotation is folded exactly when the base
rotation allows it, re-baked from samples otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An animation curve holds the value of the property: a new track starts with a
key at the current value of the property (transform, shader param, light,
renderer FX field, emitter setting or spawn / multiplier bound). The tracks
of the emitter params are bound to them by path (animCurves), a range
component gets a min and a max track.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Overrides saved from now on carry `#anim` (Diff.apply skips the `#` fields
of a diff root). Old overrides set old curve values and the properties they
were composed with: Reference.applyOverrides marks the curves they set as old
and, when the referenced .fx is already upgraded, puts the curves of the
prefabs they touch back in the old format (AnimUpgrade.legacyOverride, the
inverse of the exact bakes), so the upgrade on load bakes them with the
overridden values. A spawn range min that references its max follows the
re-baked bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he transform, tiny base angles count as none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LeoVgr and others added 30 commits October 29, 2026 16:29
…end with the keys of its two child curves

The upgrade wrote it as two paths (`a`, `b`), which the reworked curves no longer read: the param took its default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…FX curves had their own class (game code reads it, shiroLib ParameterCurve)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ParamOwner renamed BaseEmitter, without onSettingChange: Emitter and Emitter2D edit2 have their own onChange again
- EmitterEdit moved to hide.prefab.fx, takes the prefab explicitly (no casts)
- Shader: the particle params editing (getMode / setMode / getParticleEmitter) moved to EmitterEdit, the shader keeps only its particleParams
- AnimEdit removed: animKeys in EmitterParam, the current value of a new track in FXEditor
- particleDim renamed getParamSize

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inspector of the emitter params (edit, editParam, editParticleShader) is in EmitterHelper under #if domkit, as generateEdit was on master. EmitterEdit removed, param renamed editParam.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ys sets it)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ructures (as on master)

It was for the easing of the particle shader curves, removed since: no @:s structure has an optional field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kit Select: back to master, the sub menus, previews, separators, caretOnly and placeholder have no user since the curve window (and the .kit-caret-only css)
- FXEditor.addTracks: back to master's form, exec(false) was only needed by the removed animCurves bindings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eboot

# Conflicts:
#	hrt/prefab/fx/FX.hx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants