Pick a particle in SolidParticleSystem

SolidParticleSystem is a great way to reduce draw calls!:smile: We can sort the meshes according to materials, and put all the meshes using the same material into one SPS.

But its picking precision is based on every facet, if the particles has too many facets, it will leads to a big performance issue. (I don’t want to know which facet is picked, I just want to know which particle is picked.)

Is there an object/class like TransformNode, which has no business with rendering and reduces memory usage comparing with use a empty mesh, that can play a role as a pickable placeholder of the origin particle?

Or is there any other good idea to pick and highlight the particles, but reduce memory usage?

For now, the SPS picking feature is simply its underlying mesh picking feature, so facet based. There’s no such a thing like TransformNode in the SPS.

But… the SPS also supports intersections as you may know. A simple way to check ray/particle intersection would maybe then be :

  • to disable the SPS pickability
  • to enable the particle intersections instead, then to test your emitted ray against the particle bounding spheres (or with some customized bsphere ratio to tight the sphere around the particle)
    Use the Solid Particle System - Babylon.js Documentation
    This would be way faster in theory. Not tested though.