Linking rotation in instanced billboard mode

I noticed that there is a performance hit if you create a large number of instances of a plane with BILLBOARD_MODE_ALL. I’m assuming this is because instances have their own rotation, and Babylon must calculate the billboard rotation for all of the instances individually. Am I right? And if so, would it be possible to link the rotation so it only had to be calculated once? It doesn’t have to be pretty.

Or is there a better way to do this? I’m really just trying to manage lots of performant little sprites.

Thanks!

You are :wink: And you can link the rotation as they are dependent on each instance position

OK. That makes sense. Is there a way to do something kind of like a particle? They have some kind of fast add shader, and all seem to face the camera.

You know what? I need to look at the sprite manager :grin: Thanks for your help!

1 Like

I was about to say: particles, solid particles or sprites :smiley:

1 Like

Sprites have proven much more manageable for my application (for now). Can sprites be made to duplicate the look of BLENDMODE_ADD from particles?

So far it is based on COMBINE but we could certainly provide a option to swtich the default alpha mode

Feel free to create an issue for it in the repo (It will be done after 4.1 which is almost in freeze mode and will ship on 2/27)

Ummm, I went ahead and made a pull request for you (if I did it right - I’m not too good with GitHub). I haven’t tested it because I haven’t set up the build environment, but the code change is small and simple. The link is add blend mode options by IIerpos · Pull Request #7615 · BabylonJS/Babylon.js · GitHub

No pressure!

1 Like

I’ll test it asap and make the correct fixes. Thank you for the start.

But if you take a peep at the contribution guide and try to do your own build you will prolly beat me to it.

My only ask is to reuse Constants value and not introduced a new enum
everything else is fine