OpenFL GPU particles support!

Oh, yes, it may be a regional problem. I can’t access it. :thinking:

When using ShaderBuffer.update, it will consume a lot of performance. Is there a better way to update the Buffer? :thinking:

The value of paramDataLength is extremely large. If there are 1000 particles, there will be a length of 190000+.

If I just update the time, can I avoid updating it frequently?

I implemented a ShaderBuffer update method and optimized performance. Now 10000 particles can be maintained at about 20 - 30FPS.

1 Like

1W? Do you mean 1M, 1 million?

Sorry, it is 10000 :upside_down_face:

Good result indeed! What did you do to optimize the update?

The main optimization here is that particles that do not need to be updated do not update their data. If only the life time is updated, the performance of the particle will be better, and a parameter may be needed to control it. If only the life time is updated, a certain amount of randomness will be lost.

Release openfl-gpu-particles v0.0.4:

  1. New: Added copy support, copy attributes.
  2. Improvement: The improvement will synchronize the effect according to the zoom ratio of the Sprite.
  3. Added: Added randomLife random life parameter, if you don’t want random parameters, please set it to 0.
  4. New: Added GPUArrayAttribute array parameter, which can fix the queue parameter value.
  5. Fix: Fix the problem that random values would disrupt the survival status.
  6. Optimization: Optimize the data update performance of ShaderBuffer.
1 Like

Discussion: is it better to use ‘OpenglRenderer’ to implement GPU particles?