SPS and custom shader vertex buffer


I am using the SPS with a custom shader material, that needs setting of several vertex buffers like background color and etc. Since 4.1 I was recreating the SPS on change as I needed the picking to work and could not update higher than 4.1. When the SPS is new the vertex are ordered in the order of adding of the shapes, so I used the mesh of the SPS and simply set the buffers of all vertices.

My question is first if there is a better way to do this? And secondly is it save when adding and removing particles to assume that the order of the vertices is kept the same as the order of the particles?

Best Regards,
Mihail Vratchanski

Invoking the SPS mastermind: @jerome

Unless you use some kind of dynamic sort (transparent particle sort or multimaterials), the mesh geometry (so the vertex and indices order) is never modified when adding particles.
It’s extended.

When removing particles, unless they are the last ones, the orders may be modified.

Ok, and what will be the modification of the order when removing particles that are not in the end? And can I get the order from the SPS?

Removing particles not at the end is quite like rebuilding the SPS geometry from scratch.