entropy Posted October 26, 2018 Share Posted October 26, 2018 I'm a bit of a novice (with Babylon.js and 3D programming in general), so please bear with me. I'm wanting to create a scene with many repeating objects; so, of course, I want to use instancing to maximize performance. The documentation, the many examples, and countless posts on this forum eventually led me to the SolidParticleSystem. Indeed, this seems to do almost exactly what I want. The SPS seems to work great so long as all the particles are static. Tens of thousands of particles are no problem. However, that all changes as soon as the properties of the particles need to change on a regular basis. I've created a simple example to illustrate the "issue": https://playground.babylonjs.com/#H8ZQMH. (Now, in the Playground example, I could move the entire mesh at once and likely achieve better performance, but in my specific application I need to move and orient each particle independently.) After doing some further reading, my understanding is that setParticles (and updateParticle) are carried out on the CPU side, which probably explains the poor performance. Is there a way to do this on the GPU (or, rather, speed up the process in some way)? In my limited experience using DirectX directly, you would do this in the vertex buffer by, e.g., adding the instance position vector to each vertex. Would something like that be possible using Babylon.js? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.