[compat-sync] Back NPE ParticleSystem per-system runtime; sync BJS fe4f172 - #522
[compat-sync] Back NPE ParticleSystem per-system runtime; sync BJS fe4f172#522babylon-compat-sync[bot] wants to merge 1 commit into
Conversation
deltakosh
left a comment
There was a problem hiding this comment.
Found three lifecycle/state regressions in the new per-system particle wrapper.
| * prewarm has run). Idempotent. | ||
| */ | ||
| public start(): void { | ||
| if (!this._lite || this._started) { |
There was a problem hiding this comment.
_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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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).
Automated sync of
@babylonjs/lite-compatagainst the latest Babylon.js and Babylon Lite changes,produced by the
update-compat-layerskill.Synced against BJS commit:
fe4f1729c8a61f7f44c6d0e3805ad74120e7b53eValidation (run independently by the pipeline)
Changed files
ackages/babylon-lite-compat/COMPAT-STATUS.mdpackages/babylon-lite-compat/README.mdpackages/babylon-lite-compat/src/index.tspackages/babylon-lite-compat/src/materials/materials.tspackages/babylon-lite-compat/src/particles/node-particle-system-set.tspackages/babylon-lite-compat/src/unsupported/unsupported-apis.tspackages/babylon-lite-compat/tests/node-particle.test.tspackages/babylon-lite-compat/tests/unsupported.test.tspackages/babylon-lite-compat/src/particles/particle-system.ts