PhotonDust

From Resonite Wiki
(Redirected from Photon Dust)

This article or section is a Stub. You can help the Resonite Wiki by expanding it.


PhotonDust is the particle system made for Resonite[1] that replaced the Unity particle system. It is more modular and extensible than the original system[2].

PhotonDust is now in the main game, and the legacy particle system is due to be removed soon. See the GitHub discussion thread for more information.

The implementation of this system is currently tracked as issue 587 on GitHub.

How to use it

PhotonDust's modularity allows for making all sorts of effects. The particles have a life-cycle. Particles are "Born" from an emitter, "Live" or have lifetime, and then "Die".

To get started, you can use a Dev Tool's Create New menu to create a PhotonDust particle system.

This will create a PhotonDust system with a basic point emitter. A list of alternative emitters that can be used are under the Rendering/Particles/Emitters in the Attach Component menu. For any emitter added, they need the Component:ParticleSystem specified in their System field, which can be found in the root of the PhotonDust object we made. The emitter can have its values adjusted, such as Rate and Direction. More things can be controlled about the emission of particles by creating Initializer modules.

PhotonDust is made from modules, which can be read about more in the Modular approach section. To make your Particles move with gravity, forces or turbulence; simply create the module component and insert it into the Component:ParticleSystem. This will instantly make the module affect particles in the specified system. Every module respects the disabled property, meaning disabling a module will disable its effect on the Particles.

Some modules depend on other modules, for example all of the AngularVelocity modules depend on the RotationSimulatorModule. Likewise anything that changes a particle's position will depend on the PositionSimulatorModule.

How it works

PhotonDust can be compared to Minecraft's robust particle system. It is modular, fast, multithreaded and allows for forces like Blender3D's and Minecraft's particles.

Multithreading

The PhotonDust system is multithreaded and asynchronous, meaning it will do calculations on separate CPU cores to distribute the load on the machine. This allows for a much greater number of particles running at once. The particle system will visually become a slideshow in cases of high demand without ruining the overall framerate of the game.

Modular approach

Instead of condensing all of the options within a single monolithic component, the options are broken up into modules which are separate components.

Several modules are already implemented, and more will be implemented in the future. Current ones include but not limited to:

  • Ribbons - particles will have lines connecting them to each other.
  • Trails - particles will have strips of color or patterns that follow behind them as they move.
  • SimplexTurbulentForce - particles will move through the air as if hitting turbulent air (using simplex noise).
  • RadialForce - particles will be repelled or attracted to a point.
  • GravityForce - particles can have gravity.

And many more! A list of modules and their effects the game uses can be found under the component category Rendering/Particle System/Modules.

Differences from the legacy system

PhotonDust has several notable differences from the old legacy particle system that existed before. It is modular, fast, multithreaded, and doesn't fall to the same emit and forget systems of Unity. It also is a clean component, without a monolithicly large component from older days when Unity was the underlying simulator of such systems.

References

See Also