Why do particles behave differently between Babylon.js v8.8.5 and v8.9.0?

I happened to come across some old samples that had changed behavior when I was viewing them.

I looked into it and found that particle behavior seems to have changed between Babylon.js v.8.8.5 and v8.9.0. Is this an intended change?

■ Babylon.js v8.8.5
https://playground.babylonjs.com/?version=8.8.5#XHQGQJ

■ Babylon.js v8.9.0
https://playground.babylonjs.com/?version=8.9.0#XHQGQJ

This is a sideEffect of this PR Fix the ignoreParentScaling situation for the camera by deltakosh · Pull Request #16651 · BabylonJS/Babylon.js · GitHub as the view Matrix has changed quite a bit.

There are 2 solutions:

  • Reintroducing the property for back compat as the PR mentioned
  • The current rendering is the correct one as a result of the bug fix

Let s check with @Deltakosh when he ll be back next week to chose the best approach regarding this.

1 Like

Thank you for letting me know the PR that made the change.
The behavior of the sample below has also changed, but it seems to be due to the same cause.

https://playground.babylonjs.com/?version=8.8.5#P81SPG#22

https://playground.babylonjs.com/?version=8.8.5#P81SPG#21

1 Like

@Deltakosh will have a look soon or I ll address it on Wednesday when I ll be back for a couple days off.

On it!!

Alright so basically, this was a bug before :slight_smile:
As the camera has a scale (inherited), we need to compensate on the particle side. Having an option to cancel that will involve decomposing the view matrix on each frame.

So here the solution is to simply update the PG to correctly set the particle size relatively to the camera setup:
fighter + particles sample | Babylon.js Playground

Or update the child mesh scale (as the camera HAS a scaling):
Multi cameras sample | Babylon.js Playground

TLDR: Before we used to have a hack to remove the camera scaling when using gltf (which was wrong)

2 Likes