PhotonDust

From Resonite Wiki

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

PhotonDust is the name of FrooxEngine's particle system.[1]

It is extremely modular, which allows for making all sorts of effects.

Each particle has a life-cycle: Particles are "born" from an emitter, "live" or have lifetime, and then "die" at the end of their lifetime.

How to use it

To get started with using the particle system, use the Dev Tool's create menu to create a new 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 as a whole is composed of many modules. To make your particles move with gravity, forces or turbulence, simply create the desired module and insert it into the ParticleSystem component. All modules respect the Enabled property, meaning disabling a module will disable its effect on the Particles.

Some modules depend on other modules to function, for example all of the angular velocity 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, performant, and allows for forces like Blender's and Minecraft's particles.

Multithreading

The PhotonDust system is multi-threaded 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. If there's high demand, only the particle system will lag, without lowering the overall framerate of the rest of the game.

Modular approach

All of PhotonDust's functionality is broken up into self-contained modules. These can range from applying a simple force to the particles, to trails and complex color effects based on properties of particles.

Some modules include:

  • 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 it's turbulent, using simplex noise.
  • RadialForce - Particles will be repelled or attracted to a point.
  • GravityForce - Applies a gravity force to the particles.

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 was based on Unity. It is modular (unlike Unity's monolithic particle system), much more performant, and doesn't fall to the same emit and forget philosophy of Unity's particle system.

See Also

References