Skip to content

[compat-sync] Back NPE ParticleSystem per-system runtime; sync BJS fe4f172 - #522

Draft
babylon-compat-sync[bot] wants to merge 1 commit into
masterfrom
compat-sync/scheduled-2026-08-01-57288
Draft

[compat-sync] Back NPE ParticleSystem per-system runtime; sync BJS fe4f172#522
babylon-compat-sync[bot] wants to merge 1 commit into
masterfrom
compat-sync/scheduled-2026-08-01-57288

Conversation

@babylon-compat-sync

Copy link
Copy Markdown
Contributor

Automated sync of @babylonjs/lite-compat against the latest Babylon.js and Babylon Lite changes,
produced by the update-compat-layer skill.

Synced against BJS commit: fe4f1729c8a61f7f44c6d0e3805ad74120e7b53e

Validation (run independently by the pipeline)

  • ✅ compat unit tests
  • ✅ compat typecheck

Changed files

  • ackages/babylon-lite-compat/COMPAT-STATUS.md
  • packages/babylon-lite-compat/README.md
  • packages/babylon-lite-compat/src/index.ts
  • packages/babylon-lite-compat/src/materials/materials.ts
  • packages/babylon-lite-compat/src/particles/node-particle-system-set.ts
  • packages/babylon-lite-compat/src/unsupported/unsupported-apis.ts
  • packages/babylon-lite-compat/tests/node-particle.test.ts
  • packages/babylon-lite-compat/tests/unsupported.test.ts
  • packages/babylon-lite-compat/src/particles/particle-system.ts

Validation passed. Please review the wrapper changes and the updated COMPAT-STATUS.md before merging.

Opened as a draft by the compat-sync pipeline. Review and mark ready when satisfied.

@babylon-compat-sync babylon-compat-sync Bot added automation compat Missing or broken feature in the compatibility layer (@babylonjs/lite-compat) labels Aug 1, 2026

@deltakosh deltakosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found three lifecycle/state regressions in the new per-system particle wrapper.

* prewarm has run). Idempotent.
*/
public start(): void {
if (!this._lite || this._started) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_started is never cleared by stop(), so start() → stop() → start() cannot resume emission: the second call returns here even though Lite's startParticleSystem explicitly clears _stopped. Please separate the one-time billboard scheduling guard from the emission lifecycle so a stopped system can restart.

public animate(_preWarmOnly?: boolean): void {
void _preWarmOnly;
if (this._lite) {
animateParticleSystem(this._lite, 1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes preWarmStepOffset ineffective. Babylon.js advances prewarm with updateSpeed * preWarmStepOffset, while normal animation uses the regular ratio; forwarding 1 unconditionally produces different particle counts/positions whenever callers configure a non-default prewarm offset. Please use the configured multiplier when preWarmOnly is true.

"Babylon Lite's node-particle runtime is a fused struct-of-arrays simulation and exposes no per-system BJS ParticleSystem handle. Start/stop the whole set via `set.start()` / `set.dispose()`."
);
public get systems(): ParticleSystem[] {
if (!this._lite || !this._scene) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These wrappers hold particleTexture, but ParticleSystemSet.start() still registers the raw Lite set directly and never synchronizes wrapper state. Consequently, the standard set.systems[i].particleTexture = texture; set.start() sequence uses the graph's old texture or fails when none exists. Please synchronize wrapper state before set-level registration (or start through the wrappers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation compat Missing or broken feature in the compatibility layer (@babylonjs/lite-compat)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants