Skip to content

Effects: CC Particle World replaces the layer instead of compositing over it (#839) - #1117

Closed
redonion23 wants to merge 1 commit into
storytold:mainfrom
redonion23:fix/839-particle-world-transparency
Closed

redonion23 wants to merge 1 commit into
storytold:mainfrom
redonion23:fix/839-particle-world-transparency

Conversation

@redonion23

Copy link
Copy Markdown
Contributor

Fixes #839

Cause
particle_world_plan (crates/effects/src/sim.rs) shared particle_sprites with CC Particle Systems II, which maps Transfer Mode to Post::Combine: Composite drew the particles over the layer's own pixels. On a solid (the usual set-up) the layer stayed opaque and hid everything below. Before the first particle was born the plan was None, so the solid showed unchanged.

Fix
CC Particle World's plan now always uses Post::Replace: the particles replace the layer in every Transfer Mode (Add still accumulates particles with Acc::Add), and the unborn case is an empty plan, i.e. a transparent layer. The GPU compositor reads the same SpritePlan, so both paths change together. CC Particle Systems II is left as it was.

Tests

  • New sim::tests::particle_world_replaces_the_layer: an opaque black solid in each of the four Transfer Modes leaves transparent pixels between the particles, and the unborn layer is fully transparent. It fails on e2f314f7 (mode 0: transparent between particles) and passes with the fix.
  • Reproduced the report with effectcraft-cli on Windows 11 (aarch64): red solid below, black solid + CC Particle World (defaults) above, render-frame --time 1 --transparent. Before, 0 red pixels were visible. After, the red layer shows around the particles. Without the lower layer, the output is transparent (min alpha 0).
  • cargo xtask ci on Windows 11 aarch64: fmt, clippy, layers, assets and wasm pass. cargo test --workspace --release --no-fail-fast has six failures, and all six fail the same way on unmodified e2f314f7. Two assert Windows paths (\?\ prefix / absolute script path): effectcraft-cli render_out_is_relative_to_the_working_directory and effectcraft-script includes_are_inlined_relative_to_the_script. Four are GPU oracle tests on this adapter: tests_fx_lut::ocio_file_transform, tests_fx_noise::{dust_threshold_on_quantized_input, medians} and tests_fx_stylize::posterize_thresholds_strobe_vignette.

Known limits

  • particle_golden.rs (asserted on aarch64 macOS only): I re-pinned the 54 changed CC Particle World hashes whose pre-change value this machine reproduces exactly. The 14 32-bpc entries this platform already computed differently before the change (libm) still hold the old values and need SIM_GOLDEN_PRINT=1 on aarch64 macOS: ccparticleworld/{0/32bpc/t2.2, 1/32bpc/t1.5, 2/32bpc/t0.5, 2/32bpc/t0.8, 2/32bpc/t2.2, 5/32bpc/t2.2, 6/32bpc/t0.5, 6/32bpc/t0.8, 6/32bpc/t2.2, 7/32bpc/t0.5, 7/32bpc/t0.8, 7/32bpc/t2.2, 8/32bpc/t1.5, 8/32bpc/t2.2}.
  • Screen and Composite now look the same, because there is no Screen accumulation between particles (Acc has Over and Add only). Same as before for Black Matte.
  • CC Particle Systems II probably replaces its layer in After Effects too. I left it out of scope; happy to follow up.

Prepared with AI assistance (Claude Code).

🤖 Generated with Claude Code

…over it (storytold#839)

CC Particle World drew its particles over the layer's own pixels, so a solid
it was applied to stayed opaque and hid the layers below. As in After Effects,
the particles now replace the layer in every Transfer Mode (Add still
accumulates them), and before anything is born the layer is transparent.
The GPU compositor follows the same plan.

Re-pins the CC Particle World golden hashes that this platform computes
identically to aarch64 macOS; 14 32-bpc entries still need re-pinning there.

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

echelon commented Oct 13, 2026

Copy link
Copy Markdown
Member

Thank you for this, @redonion23!

#1111 landed in the same batch and fixes CC Particle World as well, together with CC Particle Systems II and the Time effects, so it supersedes this PR. If your unit test covers something #1111's tests don't, a small follow-up PR adding just that test would be welcome. Closing this one as superseded.

If you are not on our Discord yet, please join us: https://discord.gg/artcraft

@echelon echelon closed this Oct 13, 2026
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.

CC Particle World renders an opaque layer (alpha 1 everywhere) instead of particles on transparency

2 participants