Commit Graph
505 Commits
Author SHA1 Message Date
arnav-hiwarkar c07dbf32ca Merge remote-tracking branch 'upstream/main' into fix/3464-drop-shadow-softness-range 2026-11-17 20:54:02 +05:30
ash 4c38f78307 Merge pull request #3817 from arnav-hiwarkar/fix/3467-radial-blur-amount-range
Radial Blur: Amount takes After Effects' range 0..1000
2026-11-17 19:03:14 +05:30
ash 0bd848c272 Merge pull request #3153 from jayzed80/fix/parse-cube-huge-size
fix(effects): parse_cube rejects a hostile LUT_3D_SIZE before cubing it
2026-11-17 18:37:21 +05:30
arnav-hiwarkar eb14583749 Merge remote-tracking branch 'upstream/main' into fix/3467-radial-blur-amount-range
# Conflicts:
#	crates/aep/src/export/fx_defs.rs
#	crates/engine/src/tests/effect_ranges.rs
#	docs/effects-parity.md
2026-11-17 18:34:15 +05:30
arnav-hiwarkar 7f14df8355 Merge upstream main into fix/3460-gaussian-blur-range
Keeps the Gaussian Blur (#3460) and Sharpen (#3466) tests in
crates/effects/src/misc.rs; Sharpen's code is as main has it.
2026-11-17 18:08:30 +05:30
ash a188867a42 Merge pull request #3810 from arnav-hiwarkar/fix/3466-sharpen-amount-range
Sharpen: Amount takes After Effects' 0..4000 range (#3466)
2026-11-17 18:06:39 +05:30
arnav-hiwarkar ff9584fa64 Merge remote-tracking branch 'upstream/main' into fix/3467-radial-blur-amount-range
# Conflicts:
#	crates/engine/src/tests/effect_ranges.rs
#	docs/effects-parity.md
2026-11-17 17:57:33 +05:30
arnav-hiwarkar 69666e68c7 Merge upstream main into fix/3460-gaussian-blur-range
Keeps the Gaussian Blur (#3460) and Turbulent Displace (#3469) rows in
the engine range test and the effects parity log.
2026-11-17 17:57:21 +05:30
arnav-hiwarkar 1654633bcf fix(effects): test the cube row bound without a huge input 2026-11-17 17:33:35 +05:30
arnav-hiwarkar ce0c4c8a75 #3464: Drop Shadow: blur before moving when the margin is cut
With the padding cut to its budget, a Distance larger than what's left
of the margin moved the layer out of the buffer before the blur, so the
blur had nothing to spread back in: a 64 x 48 layer moved 3000 px at
Softness 8000 left no shadow at all. The cut-margin path now samples
only the fraction of the move and lets the blur move the rest:
raster::gaussian_blur_unbounded_at evaluates the transparent-edged blur
of the image at a whole-pixel shift, through a window the size of the
buffer, so content outside the window still reaches into it. Margins
that fit are unchanged.

The blur's intermediate rows are freed before the output is allocated,
so it holds at most three buffers at once. On an M-series Mac a
4096 x 4096 layer at Softness 30000 takes 0.51 s, and 1080p 0.13 s.
2026-11-17 17:30:44 +05:30
arnav-hiwarkar 06c41a1ee4 fix(effects): merge current upstream main into cube safety fix 2026-11-17 17:27:35 +05:30
arnav-hiwarkar 1eb4f39808 fix(effects): bound cube data row collection 2026-11-17 17:27:22 +05:30
arnav-hiwarkar 95685d8d41 Merge remote-tracking branch 'upstream/main' into fix/3469-turbulent-displace-amount-range
# Conflicts:
#	docs/effects-parity.md
2026-11-17 17:26:50 +05:30
arnav-hiwarkar ae2d595d9d fix(effects): exercise the wrapped combined cube row count 2026-11-17 17:25:47 +05:30
arnav-hiwarkar 83285272e3 Merge upstream main into fix/3460-gaussian-blur-range
Keeps the Gaussian Blur (#3460), Fractal Noise (#3486) and CC Power Pin
(#3492) rows in the effects parity log.
2026-11-17 17:25:22 +05:30
arnav-hiwarkar ffdcdb507d Merge remote-tracking branch 'upstream/main' into fix/3464-drop-shadow-softness-range 2026-11-17 17:25:13 +05:30
arnav-hiwarkar cebe224d85 Merge remote-tracking branch 'upstream/main' into fix/3467-radial-blur-amount-range
# Conflicts:
#	docs/effects-parity.md
2026-11-17 17:24:34 +05:30
arnav-hiwarkar 5adc96bfbf Merge remote-tracking branch 'upstream/main' into fix/3466-sharpen-amount-range
# Conflicts:
#	crates/engine/src/tests/effect_ranges.rs
2026-11-17 17:24:31 +05:30
arnav-hiwarkar 9bb0db0207 Merge upstream main into fix/3460-gaussian-blur-range
Keeps both the Gaussian Blur (#3460) and CC Power Pin (#3492) rows in
the engine range test and the effects parity log.
2026-11-17 16:55:18 +05:30
arnav-hiwarkar 969286ae76 #3460: review: name the open follow-up for SLIDERS_0_24, use the shared pixel budget in the test
The table holds only Gaussian Blur's row; the ranges changed since 0.24.1
by other work are tracked in #3815. The 30000 render test checks the
buffer against crate::pixel_budget instead of a copied constant.
2026-11-17 16:52:08 +05:30
arnav-hiwarkar 8fe42b29c6 Merge remote-tracking branch 'upstream/main' into fix/3464-drop-shadow-softness-range 2026-11-17 16:49:21 +05:30
arnav-hiwarkar 79d4be499d Merge remote-tracking branch 'upstream/main' into fix/3466-sharpen-amount-range
# Conflicts:
#	crates/engine/src/tests/effect_ranges.rs
#	docs/effects-parity.md
2026-11-17 16:48:30 +05:30
arnav-hiwarkar 63ec0033d1 #3486: merge main (CC Power Pin range rows in the shared tables) 2026-11-17 16:48:19 +05:30
arnav-hiwarkar a3ab20e9f7 Merge remote-tracking branch 'upstream/main' into fix/3469-turbulent-displace-amount-range
# Conflicts:
#	crates/engine/src/tests/effect_ranges.rs
#	docs/effects-parity.md
2026-11-17 16:46:35 +05:30
arnav-hiwarkar 8420bb9f4d Merge remote-tracking branch 'upstream/main' into fix/3467-radial-blur-amount-range
# Conflicts:
#	crates/engine/src/tests/effect_ranges.rs
#	docs/effects-parity.md
2026-11-17 16:46:29 +05:30
arnav-hiwarkar cec04744f3 #3464: Drop Shadow: test a huge Softness; say what the GPU test checks
A Softness far past the range (an expression can set one) overflowed
the padding's u32 before drop_shadow_pad saturated it; the new test
panicked there in a debug build and renders a finite shadow now. The
GPU test's comment and the parity row now say that a cut margin renders
on the CPU, and the CPU test quotes the measured 0.11 at Softness 8000.
2026-11-17 16:24:22 +05:30
arnav-hiwarkar f149b65c57 #3464: Drop Shadow: Softness takes After Effects' range
Softness took 0..1000, so prop.set and the value editors clamped values
After Effects accepts: its recorded definition for ADBE Drop Shadow
allows 0..30000 in the same pixels (the .aep mapping is plain). The hard
range is now 0..30000; the default (0) and the slider (0..250) are
unchanged. Projects saved with the old range take the new one on open.

The .aep range guard loses its allow-list row, and the engine test sets
both ends through prop.set, undo / redo, save / reopen and an old
project. Keyframe text keeps no unit for it (only 0..100 sliders read
as percent).
2026-11-17 16:24:22 +05:30
arnav-hiwarkar 8903090007 #3464: Drop Shadow: keep the whole blur when the padding budget cuts the margin
Drop Shadow pads its buffer by Distance + 1.5 x Softness, but the pixel
budget (#2261) cuts that margin for a large Softness: from about 870 on
a 1080p layer. The box passes then dropped what they spread past the
edge, so the shadow came out too faint: at the centre of a 64 x 48
layer, 0.11 of the Gaussian at Softness 8000. With a cut margin the CPU now blurs as
if the buffer went on with transparency (the Gaussian is unchanged,
sigma = Softness / 2). The GPU hands that case to the CPU and keeps
every margin that fits, so those results are unchanged.

Measured on an M-series Mac: 1080p at Softness 30000 takes 0.10 s, and
a 4096 x 4096 layer (an 8192 x 8192 buffer) takes 0.99 s on the CPU.

The pad is computed once for both paths (drop_shadow_pad) and saturates
instead of overflowing on a huge Softness.
2026-11-17 16:24:22 +05:30
arnav-hiwarkar e60d6ac706 #3486: review: the octave test checks the bound; clearer bound comment
The octave test asserts both values stay within OCTAVE_SCALE_MAX (it
passed with the bound removed). The comment names Perspective Offset as
what multiplies the offset by the depth, and says why an octave at the
bound has no detail.
2026-11-17 16:22:07 +05:30
arnav-hiwarkar a62564b567 #3469: locked pinning clamps without f64::clamp
The sub-pixel bounds lx + ix and lx + lw - ix round separately, so at third
resolution they can still cross by an ulp and f64::clamp panics; a NaN
layer size panicked too. max/min equals clamp whenever the bounds are
ordered and cannot panic. The test now covers half and third resolution at
fractional offsets and a NaN layer size. The parity note says Amount, not
the displacement, is bounded to 2^24 px.
2026-11-17 16:19:44 +05:30
arnav-hiwarkar d5e74c880f #3467: Radial Blur docs say the wide Zoom shape is unmeasured
The spin helper's name gives its unit (degrees), the zoom helper's doc
uses |amount| as the code does, and the parity row and tests say what
is and is not checked against After Effects.
2026-11-17 16:15:51 +05:30
arnav-hiwarkar 4cf7741340 #3469: Turbulent Displace locked pinning on a sub-pixel layer
Locked pinning clamped samples to lx + 0.5 .. lx + lw - 0.5. On a layer
under a buffer pixel across (a 1-pixel layer at half resolution) the bounds
cross and f64::clamp panics. They now meet at the layer's centre there and
are unchanged otherwise.
2026-11-17 16:14:01 +05:30
arnav-hiwarkar 040fe61b84 #3469: Turbulent Displace stays finite at any Amount
Expressions are not clamped to the hard range. Padding computed
amount.abs().ceil() as u32 + 1, which overflowed (a panic in debug builds)
from about 4.3e9 on both the CPU and GPU paths, a NaN Amount filled the
layer with NaN, and an infinite one sent infinite coordinates to the
samplers' integer pixel positions.

turbulent_amount_px, shared by both paths, skips a zero or NaN Amount and
bounds the rest to 2^24 px. Values inside the hard range are unchanged.
Tests cover both ends of the range with every displacement kind, pinning
and Resize Layer (finite, padding within budget), Amounts past it, and
CPU/GPU agreement at -10000, 10000 and infinity.
2026-11-17 16:13:10 +05:30
arnav-hiwarkar 2e17ed1d83 #3469: Turbulent Displace Amount takes After Effects' valid range
The hard range was -1000..1000, so prop.set and the Effect Controls and
Timeline editors clamped Amount values After Effects accepts. The recorded
ADBE Turbulent Displace definition allows -10000..10000 (plain units, no
conversion). The default and the -200..200 slider are unchanged.

The .aep range guard no longer lists the parameter as narrower, and the
engine range test covers both ends through prop.set, undo/redo, save and
reopen, and projects saved with the old range.
2026-11-17 16:12:25 +05:30
arnav-hiwarkar ec1294a1d2 #3486: Fractal Noise: Sub Scaling takes After Effects' 10..10000
After Effects records Sub Scaling's valid range as 10..10000 (slider
25..100), but the hard range stopped at 100, so prop.set and the value
editors clamped 200 to 100. The CPU renderer and the GPU pointwise path
also capped the ratio at 1, so a value above 100 rendered as 100 even
once stored.

Widen the hard range for Fractal and Turbulent Noise (they share the
parameter; slider and default unchanged) and take the ratio from one
sub_scaling_ratio (0.1..100) on the CPU and both GPU paths. Above 100
each octave is larger than the last.

Tests: the range and that 200 and 10000 render differently from 100;
finite output at both ends with Complexity 20, Perspective Offset,
Turbulence Factor 10 and a huge offset; CPU/GPU parity at 200 and 10000
on the pointwise and fxn_fractal paths; prop.set, undo/redo and
save/reopen keep 10 and 10000 (engine range table). The .aep range
guard no longer lists the parameter.
2026-11-17 16:10:16 +05:30
arnav-hiwarkar f98c3e9ba2 #3467: Radial Blur Zoom past 200 stays on its side of the centre
Zoom spreads its 32 samples over scales 1 ± Amount / 200 about the
centre. Past Amount 200, which the range now allows, that reaches below
0 and samples the layer mirrored through the centre: at 1000 a layer
white on the left and black on the right turned the right half 35 %
grey.

raster::radial_blur_zoom_scale keeps the old scales up to 200 exactly
and spreads the samples evenly from the centre to 1 + Amount / 200
beyond. The CPU and GPU paths both take their samples from it. Work per
pixel stays at 32 samples at any Amount.
2026-11-17 16:09:38 +05:30
arnav-hiwarkar 12480ab94e #3492: say when crossed Expansion sides flip the CC Power Pin source
The source rectangle flips when two opposite sides add up to less than
-100 %, not when one side alone does.
2026-11-17 16:09:32 +05:30
arnav-hiwarkar d918aa6e13 #3467: Radial Blur Amount takes After Effects' range 0..1000
After Effects records 0..1000 for Radial Blur's Amount (slider 0..100);
EffectCraft's hard range stopped at 100, so prop.set and the value
editors clamped 200 to 100. The hard maximum is now 1000; the slider
range and default are unchanged.

The engine range test covers prop.set at both ends, undo and redo, save
and reopen, and a project saved with the old range. The parameter leaves
the .aep range guard's list of known narrower ranges.
2026-11-17 16:09:29 +05:30
arnav-hiwarkar 8f7896b28a #3486: Fractal / Turbulent Noise: bound octave scales and scaled offsets
Each octave's frequency and Perspective Offset depth are Sub Scaling to
the power of the octave. Above 100 % (After Effects allows 10000) that
reaches 100^±19 at Complexity 20, and Perspective Offset or Turbulence
Factor times the offset overflowed to infinity and drew NaN.

Both stay within 1e20 and its inverse and remain each other's inverse,
so an octave's offset in lattice cells is unchanged; 10..100 never
reaches the bound. The scaled offset stays within 1e36 px, past where
the lattice index saturates. The CPU, fxn_fractal (from fractal_gpu)
and pointwise paths share the bound; one octave_origin replaces the two
copies of the origin code.
2026-11-17 16:07:18 +05:30
arnav-hiwarkar ef7dd7f3d1 #3460: Gaussian Blur: Blurriness takes After Effects' range 0..30000
After Effects records Blurriness as valid from 0 to 30000; the hard range
was 0..3000, so prop.set and the value editors clamped 4000 to 3000. The
default (0) and the 0..50 slider stay as they were. Padding stays within
the effect pixel budget at the new maximum, on the CPU and the GPU.

Tests: the engine round trip (prop.set, undo/redo, save/reopen, older
projects) gets a row, the aep guard drops its known-narrower row, and the
CPU and GPU render at 30000 is checked bounded, finite and matching.
2026-11-17 16:06:36 +05:30
arnav-hiwarkar e83be3a08f #3486: Fractal Noise: lattice neighbours wrap past the i32 range
At Sub Scaling 10 % and high Complexity an octave's lattice coordinates
pass the i32 range. The cast saturates, and adding the neighbour offset
overflowed (a panic in debug builds). Wrap it, as the GPU's i32 adds do.
2026-11-17 16:05:40 +05:30
arnav-hiwarkar 1a4697de31 #3466: test Sharpen's render at Amount 4000
At the top of the new range the CPU render stays linear in Amount
(colour moves Amount / 50 of its difference from the blur) and finite on
32 bpc over-range input, and the GPU matches the CPU at 8 and 32 bpc.
2026-11-17 16:05:37 +05:30
arnav-hiwarkar 1dc70637bd #3466: Sharpen Amount takes After Effects' 0..4000 range
The hard range was 0..500, so prop.set and the value editors clamped
values After Effects accepts (its recorded valid range is 0..4000; the
0..100 slider and the default are unchanged). The engine range test now
covers both ends through prop.set, undo/redo, save/reopen and projects
saved with the old range, and the recorded-range guard no longer lists
Sharpen as narrower.
2026-11-17 16:05:29 +05:30
arnav-hiwarkar 9e3cfa639a #3492: test CC Power Pin below -100 % Expansion on CPU and GPU
Below -100 % an Expansion edge crosses the opposite one and the source
rectangle flips. Pin that geometry, check that the extremes (including
a zero-size source and Unstretch) keep the buffer size and render
finite pixels, and compare CPU and GPU at the new minimum.
2026-11-17 16:04:45 +05:30
arnav-hiwarkar cfea5b4bf9 #3492: CC Power Pin Expansion takes After Effects' -200 minimum
Top, Left, Right and Bottom Expansion had a hard range of -100..1000, so
prop.set and the value editors stored -100 for After Effects' valid
-200..-100. The hard minimum is now -200; the 1000 maximum, the default
and the 0..100 slider are unchanged. The engine range table covers both
ends through prop.set, undo/redo, save/reopen and an older project's
stored range, and the four rows leave the aep KNOWN_NARROWER list.
2026-11-17 16:04:44 +05:30
Dylan M. Taylor 6d908d1301 Merge pull request #3215 from vangel76/cc-ball-action-params-3197
Ball Grid effect has all of After Effects' CC Ball Action controls, including flat balls without shading
2026-11-16 20:39:25 -05:00
Dylan M. Taylor 9fa8a069da Merge current main and pin merged shared Sony LUT readers 2026-11-16 06:51:41 -05:00
Dylan M. Taylor 414cddf4fe effects: use shared SPI3D and SPIMTX readers 2026-11-15 14:03:12 -05:00
Dylan M. Taylor d7d6007970 effects: use shared SPI1D table reader 2026-11-15 13:49:50 -05:00
.CooCoo d6c9ad6643 Cineon Converter: Gamma 1 gives linear output and saved projects keep their render (#2312)
## Behavior

A new Cineon Converter opens with Gamma 1.7. Its Version parameter is 2 by default. A converter saved before Version existed opens as version 1, retaining its Gamma value, keyframes, and expression text and rendering on its original scale. Reset keeps the instance's Version.

In version 2:

- Log to Linear raises the exposure to `1 / gamma` before subtracting the black offset and normalizing: `(E^(1/g) - O^(1/g)) / (1 - O^(1/g))`, with `E = 10^((code - white) * 0.002 / 0.6)` and `O` the exposure at the black point. Gamma 1 gives linear output, and a larger Gamma lightens the midtones. Highlight Rolloff then applies as before, and Linear to Log is the inverse.
- Log to Log returns code values unchanged at Gamma 1 and raises the normalized code value to `1 / gamma` at other values. With custom black or white points, the code values first go through the Gamma 1 conversion.

The CPU and GPU paths match. Version 1 instances render as before, and Interpret Footage ▸ Cineon Settings keeps its existing formula, which agrees with the version 2 Converter at Gamma 1.

The public Cineon Converter documentation (https://helpx.adobe.com/after-effects/using/utility-effects.html) describes Gamma as a midtone control and gives no defaults or formula. The default, the Log to Linear curve and the Log to Log behavior come from running and scripting After Effects 26.5 on my own machine and reading back the rendered pixels. In After Effects, choosing Log to Log also sets Gamma to 1 and Highlight Rolloff to 0; EffectCraft does not do that yet, because no command sets one parameter from another.

Animation preset format 3 records `cineonVersion` for a saved Gamma property and stores effect key times relative to the first key. Presets in formats 1 and 2 without that tag contain version 1 Gamma values; format 2 already has relative effect key times. Applying a whole old Cineon Converter also gives it version 1. Exposed Essential Properties Gamma values convert to the target converter version where their target is unambiguous (the conversion keeps the linear point; other Gamma values follow each version's own curve); enabled expressions on another scale are skipped instead of rewriting their source.

A saved Gamma records the Version its converter has at the current time. Applied to a converter whose Version is keyframed, a Gamma preset keeps those keys: the Gamma is converted to the one version they hold, or skipped when they hold several or an expression sets the Version. A preset that also holds the Version sets it from that property.

The project schema remains 2. `docs/architecture.md` describes the behavior above.

## Validation

Effect tests check version 2 Log to Linear at Gamma 1.7 (codes 95 to 685) and Gamma 2.2 (codes 180 to 620), and Log to Log at Gamma 1 (Rolloff 0 and 20) and Gamma 1.7, against the measured 8-bit values within one or two codes, plus round trips, version 1 rendering and the Interpret Footage agreement at Gamma 1. GPU tests compare the version 2 paths with the CPU. Engine tests cover old projects, Reset, presets, keyframes, and Essential Properties.

Commands run on `74d398c2`:

- `cargo fmt --all -- --check`
- `cargo clippy -p effectcraft-effects -p effectcraft-gpu -p effectcraft-project -p effectcraft-engine --all-targets -- -D warnings`
- `cargo test -p effectcraft-effects`: 546 passed (including `effects_doc_is_current`, so `docs/effects.md` needs no change), 1 ignored, plus 6
- `cargo test -p effectcraft-project`: 47 passed
- `cargo test -p effectcraft-gpu`: 253 passed, 1 ignored
- `cargo test -p effectcraft-engine`: 1,007 passed, 5 ignored, plus 27
2026-11-15 12:11:07 +01:00