Tutorial:Particles
More actions
Resonite uses a fully custom system called PhotonDust, due to it's complexity it can be quite intimating to get started doing custom systems. This page intends to be a starting point that gives an overview then examples of a few systems and how each one works.
Overview
Each Particle System needs a number parts to make it work:
- Component:ParticleSystem - The 'root' of the whole Particle system.
- This is where the simulation runs, disabling this component clears every running particle attached to it.
- It can be anywhere in the world and moving it won't effect how particles behave.
- Each ParticleSystem can only have one style. You can however have multiple particle system running at once that share the same style(see bellow).
- Allowing for example different simulation spaces or different sets of particles to be disabled at once.
- Component:ParticleStyle - This is what ties all the effects together into a single package.
- This list is all the components that make up 'one effect'. Comprised of a number of modules that interact together.
- The 'output' of this is then feed to the chosen renderer via it's
Rendererfield.
- Particle System:Renderers - Rendering type that define how the particles in a particle system should be rendered.
- The most common is BillboardParticleRenderer that renders each particle similar to a quad with a texture applied to it facing the viewer.
- This component references any required Materials
- Particle System:Emitters - Different sources of particles that emit particles into a particle system simulation.
- This is what actually creates new particles. They come in different shapes/styles.
- The emitter's coordinates are where the particles come from.
- They reference the ParticleSystem component, adding new particles into that simulation.
Modules
This is the core and also the most complicated part of the system, different modules act as creators or modifiers to particles, changing how they behave.
All modules respect the Enabled property in real-time, allowing effects to be toggled on/off. For example: Disabling gravity effects or switching between two different initializer types.
A few examples and types are explained below. For the full list, see: Category:Components:Rendering:Particle System:Modules
- Initializers - Control how particles are created and their initial properties
- Component:LifetimeRangeInitializer - Sets how long a particle exists for until it 'dies'.
- Component:ColorRangeInitializer - Sets the initial colour a particle is when it's created.
- Component:SpeedRangeInitializer - Sets the initial speed of a particle is moving at when created.
- Simulators - These run the parts of the physics that cause changes over time.
- Component:PositionSimulatorModule - This is required to allow particles to move. For example GravityForce or SpeedRangeInitializer
- Component:RotationSimulatorModule - This is required to allow particle to rotate.
- OverLifetime - Control how an effect changes as the particle exists
- Component:UniformSizeOverLifetimeStartEnd - Makes a particle change from one size to another over it's life
- Component:ColorOverLifetimeStartEnd - Makes a particle change from
- Force/Direction - Control how particles move/change over time (Physics)
- Component:GravityForce - How/if a particle is effected by gravity. Negative for up, positive for down.
- Component:RadialForce - Pushes a particle towards or away from center of
OverrideForceSpace
- Trail - Effects that drag behind a particle.
- Component:ParticleRibbonsModule - Pretty!
- Other - Misc modules
Examples
<This part I need a lot of help with!>
Default
- ParticleStyle
- Component:LifetimeRangeInitializer - MinValue: 1 MaxValue: 5
- Exists from 1 to 5 seconds
- Component:ColorRangeInitializer - MinValue: 0,0,0,1 MaxValue: 1,1,1,1
- Colored from pure black to pure white
- Component:UniformSizeRangeInitializer - MinValue: 0.02 MaxValue: 0.1
- Component:SpeedRangeInitializer - MinValue: 0.1 MaxValue: 1
- Component:AngularVelocityRangeInitializer - MinValue: -90 MaxValue: 90
- Could be spinning in any direction
- Component:PositionSimulatorModule - Needed for movement
- Component:RotationSimulatorModule - Needed for rotation
- Component:LifetimeRangeInitializer - MinValue: 1 MaxValue: 5
- Renderer
- Material - UnlitMaerial - 1,1,1,1 Tint. Alpha - BlendMode.
- Pure white material that isn't effected by lighting
- Emitter
- Component:SphereEmitter - Rate: 10 Radius: 0.1
- 10 particles per second emit from anywhere within a sphere of 0.2 units across.
- Component:SphereEmitter - Rate: 10 Radius: 0.1
Smoke
Blobs that float and drift up from the origin point, expanding and becoming fainter as they do so
Glitter
Big bust of flat pieces that spread out and drift down
Fire
Water
Blobs that flow and bounce, obeying gravity and surfaces