How to support different particle details (low, medium & high)

I have 2 questions about particle details that might affect performance;

  1. If we provide different particle levels (low, medium & high) for users what attributes should we take care of? (e.g. if a user selects low-detailed particles - should we decrease particle count for example? - what are the others)
  2. Are there any performance tricks that we could apply? (e.g. batching we do for models)

This is something I’ve not looked closely yet myself tbh.

AFAIK, the main factors are:

  • The number of particle systems - Graphs for the simulation are generated per system created when they are first enabled
  • The number of live particles per system - More particles means more simulation calculations per frame
  • Extra options such as sorting, depth softening, number of maps - More expensive to render per particle

I’m afraid there aren’t any easy tips to apply here without digging into the particle code itself. I did look at adding a ‘prepare’ function so that the developer was in control of when the cost of generating the graphs instead of first enable. Added API to allow developer control of when to create the emitter by yaustar · Pull Request #2002 · playcanvas/engine · GitHub Unfortunately it didn’t make it in.

I also was looking at cloning data for pools to again save on cost: Cloning particle emitter data API discussion by yaustar · Pull Request #2003 · playcanvas/engine · GitHub

1 Like

Thank you so much for the detailed explanation! I’ll have a look/examine these attributes in more depth.