Skip to content

Look into making GPU-accelerated particles #1136

@einarf

Description

@einarf

Arcade has a simple particle system using Sprite and SpriteList. The current system simple and fairly well designed.

  • particle.py: Implements a Particle with a mutation callback support. A few other standard particle types are created from this type (lifetime, fading, eternal) mainly implementing a custom update method to implement the behavior with extra attributes if needed.
  • emitter.py implements and emitter system and various controllers for this
  • emitter_simple.py provides simple functions to make a burst and interval emitter for users having simpler use cases

We should look into making a GPU version of this. We have all the tools in the world to make this happen now. Transforms support single and separate buffers. An initial limitation would be no collision support, but this can potentially be added later as this field expands.

Key points for this system is:

  • Support creating the initial particles from the python side
  • Support emitting particles from the python side
  • Support creating initial paricles from the GPU side
  • Support emitting particles from the GPU side (transform with offset)
  • Similar system for mutation callbacks
  • We could actually support a system that would manupulate the SpriteList buffers and potentially also support syncing down the transformed data into the array objects. This could make it simpler in the future when it comes to collision. However, we need to sort out how SpriteList can handle stale data. Possibly the static parameter can help.
  • We should be able to define our own particle attributes in addition to SpriteList attributes.
  • Support collision texture/map. N particels to N wall sprites is not esily done without it.
  • Callback for collision
  • Documentation and tutorials will be very important.
  • Proper unit tests important

We might also need to provide a glsl library with useful functions such as pseudo-random number generation and other things to get the user started.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions