From 788bcf12ac5aae791e45ec1838758f8949e2c056 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 08:29:09 +0000 Subject: [PATCH] Particles: particles are on their emitter's visibility layer A camera draws a renderable only if it and every container above it share a layer with the camera's cullMask. Particles stayed on layer 1 whatever their emitter was on, so a camera that drew only the emitter's layer (the way to give an effect a camera of its own) drew the emitter and none of its particles. Particles are now born on their emitter's visibilityLayer, and the emitter fans a change out to the live ones on its next update, as it already does for blendMode. A pooled particle no longer keeps the layer of its last life. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01JnzwA2BZwXkRJLpNxCXBNt --- packages/melonjs/CHANGELOG.md | 1 + .../melonjs-camera-and-drawing/SKILL.md | 3 + .../melonjs-particles-and-trails/SKILL.md | 1 + packages/melonjs/src/particles/emitter.ts | 29 +++++++++ packages/melonjs/src/particles/particle.ts | 4 ++ .../melonjs/tests/camera-cull-mask.spec.js | 62 +++++++++++++++++++ 6 files changed, 100 insertions(+) diff --git a/packages/melonjs/CHANGELOG.md b/packages/melonjs/CHANGELOG.md index 16eb999db..f9f27b786 100644 --- a/packages/melonjs/CHANGELOG.md +++ b/packages/melonjs/CHANGELOG.md @@ -23,6 +23,7 @@ - UI: `UITextButton#bitmapText`, for `label` ### Fixed +- Particles: particles are on their emitter's `visibilityLayer`, and follow a change to it. They stayed on layer 1, so a camera whose `cullMask` drew only the emitter's layer drew none of its particles - Loader: assets on the game's own origin are requested with its cookies and HTTP auth, so a game behind a login no longer gets a 403 for every asset ([#1801](https://github.com/melonjs/melonJS/issues/1801)) - Loader: an asset on another origin loads whenever its server allows it (CORS), without `crossOrigin`, and one it does not allow fails at load with an error naming it, instead of later with "Unexpected end of input" or "The source image could not be decoded". `crossOrigin` now only applies to the `