I’m a scientist trying to create a fancy animated plot using babylon.js.
Basically I have two sets of x,y,z coordinate data for 1,000,000 data points, let’s call them position A and position B.
I’d like to create a 3d scatter plot and animate the movement of each point (particle?) from position A to position B.
Due to the large number of points the animation should use the GPU. I can see that it’s possible to define a start position for each point/particle (Customize Particle System - Babylon.js Documentation). If I could add an end position then it should be possible to animate the points moving from A to B on the GPU? Is this supported? If not, could you kindly consider adding the functionality? For science.
I’m here after trying ThreeJS and finding that animating this many CPU particles is quite painful – it really needs to happen on the GPU for a smooth experience.
I’m new to this (some d3.js only), so I worry that if I tried to hack together / implement my own start->end GPU tweening algorithm it would take an unreasonable amount of time!
Thanks though, I’ll watch the thread for any updates. It seems from a couple of previous posts on the forums here that there may be some demand for this feature… fingers crossed somebody can implement it!
Thanks to some help from Evgeni_Popov here are two PGs based on @jerome’s suggestion. Both have 1 million points, the first uses the CPU, the second a shader. You can see the difference
@Deltakosh Thanks for the amazingly quick turnaround.
And thanks @JohnK@jerome@Evgeni_Popov it’s great to have different options – the PG’s are also a clear illustration of the advantage of animating with a GPU shader vs CPU.
Would appreciate any pointers on matching the functionality of the shader GPU PG (i.e. XYZ ->XYZ, https://www.babylonjs-playground.com/#U2C1Q6#5) using the new custom emitter, if at all possible? My initial attempt was to specify ManualEmitCount = n_particles with an “infinite” minLifeTime; however, ManualEmitCount isn’t supported with GPU. Is there another way?
For the GPU you may need to have a timer aligned with a static lifetime and when the timer is done you can kill the current particle system and replace it with a static one (where destiation = intial position)