How to use BILLBOARDMODE_STRETCHED?

Hi, I’ve been attempting to get BILLBOARDMODE_STRETCHED to work but unsure how to use it. I couldn’t get it working locally in my project (simply adding particleSystem.billboardMode = ParticleSystem.BILLBOARDMODE_STRETCHED means I don’t see any particles)

I attempted to modify the simple playground here https://playground.babylonjs.com/#0K3AQ2#3 with that line, resulting in https://playground.babylonjs.com/#0K3AQ2#937 - but as you can see, the particles are no longer visible. Is there something else that must be added for it to work?

I’m looking to add sparks like in this pic
image

(fyi, the playground for billboardmode_stretched Babylon.js Playground linked in the docs seems to be broken, nothing shows on the screen - but simply commenting billboardmode_stretched doesn’t seem to fix it so probably something else going on)

Hmmm… this is strange.

I tried for your demo explicitly adding particleSystem.isBillboardBased = true; (Don’t actually think you need this) but didn’t seem to do anything either.

As for the demo in the docs. Babylon.js Playground I too was a little mislead at first because I saw nothing as well. But then if you read the code a little bit line 162 you’ll see you have to press space to get it to start and it’s working just fine. :wink:

if(event.keyCode == 32) 
        {...

That said I’m not sure what’s wrong with you code specifically so I’m going to look more. I pulled another demo which I also noticed did not seem to do anything until I moved to 4.2 version so it could be a hidden bug somewhere or that could be unrelated.

This is definitely a bug in 5.0 where I suspect some particle computation are having a glitch in this mode. we ll address this ASAP

2 Likes

Thanks! It’s a cool feature to have, looking forward to implementing with it once fixed :smile:

1 Like

@sebavan https://playground.babylonjs.com/#B9HKG0#0 here is the other demo in our docs that works on 4.2 but not 5.0 for debugging.

@msDestiny14 can you update the doc ? the https://playground.babylonjs.com/#B9HKG0#0 has a boolean on line #36 which is incorrect (it was simply ignored in 4.2)

Here is the fix: Particle billboard | Babylon.js Playground (babylonjs.com)

cc @PirateJC

3 Likes

Will do!

Fix is in PR:
fix billboard_stretched by deltakosh · Pull Request #11858 · BabylonJS/Babylon.js (github.com)

2 Likes