Archive 17/01/2023.

Spatial Partitioning for 2D particle system

sabotage3d

Hi guys,

I have a simple 2D particle system in Urho3D and I would like delete particles based on region. At the moment I need to loop all the particles to compare the distance from the culling area. In addition I would like to add simple collision queries. Would you suggest a good spatial partitioning that I can use to optimize it? If there is something readily available with Urho3D or something as an external lib.

codingmonkey

Hi, you may try to render your areas into additional RT (8 bit) and then use this RT as mask for discard pixels in shader when you render your patricle emitter. I guess this easy way to achive this effect with less efforts

sabotage3d

Thanks codingmonkey. I would prefer to remove the actual particles. Using RT would make this very difficult.