Search
Start typing to search...

Particle System

Author:

Introduction

In this document, we will talk about how you can create particle effects using Aximmetry's native render engine.

What is a Particle System

A particle system is a technique in computer graphics that utilizes many small elements, sprites, or 3D models to achieve a more complex effect that would be hard to replicate such as fire, rain, smoke, or other similar effects.
These small elements are called particles.
Aximmetry has a CPU-based particle system that lets you create and adjust these effects in real-time.

How Does a Particle System Work

Particle systems are made up of different components.
These components are:

  • Source: This will be the spawn point of the particles
  • Effectors: They control how the particles look like and move in the virtual space

Particle Sources

The Particle Source is what the particles will spawn from.
In Aximmetry you can use 3 different types of particle sources. These sources can be added the same way as any other node inside Aximmetry.

  • Particle Cube Source - the particles are emitted from a cube
  • Particle Sphere Source - the particles are emitted from a sphere
  • Particle Model Source - the particles are emitted from a model, the model can be an Aximmetry primitive or any imported model.

Particle Types

Sprite Particle

The particles are little images (or image sequences) such as raindrops or sparks. In practice, the image can be anything.
This type of particle system is the most commonly used.
Some examples where Sprite Particles could be used:

  • Rain
  • Clouds
  • Fire

Object Particle

The particles emitted are models. You can use object particles to have a more realistic 3D effect.
These are less frequently used and are more costly to render but can look more realistic.
Some examples where Object Particles could be used:

  • Stones falling
  • Effects that should cast or receive shadows or interact with the virtual lights

NOTE: If you wish to show many 3d objects you might be better off with instancing. You can see examples for instancing here:  \Tutorials\Instancing

Particle Effectors

Particle Effectors are modules that control how a particle looks and behaves in the 3D environment.

Aximmetry offers a lot of particle effectors:

  • Particle Animation - Can be used with Sprite Particle if an Image sequence is used you can step through the images with this module.
    • You can use the Start Time and End Time properties to specify which images of the sequence are displayed randomly.
  • Particle Color - Can be used with Sprite Particle to colorize it throughout its lifetime.
  • Particle Fluctuation - The opacity of the particle will fluctuate between the min and the max value.
  • Particle Gravity - Particles will be affected by gravity, you can specify the direction, strength, and many more things.
  • Particle Highlight - Particles will have a highlight on them, simulating a bloom effect.
  • Particle Mapped Veloc - Movement of the particle will be controlled by a Velocity Map texture.
  • Particle Maze - The Particle will move in a maze-like pattern.
  • Particle Model Deflector - The particles will be deflected from a model.
  • Particle Opacity - This can be used with Sprite particles, their opacity can be adjusted throughout their lifespan.
  • Particle Oscillation - The particles will oscillate around the source.
  • Particle Plane Deflector - The particles will be deflected from a plane.
  • Particle Roaming - The particles will roam around the source.
  • Particle Rotation - The particles will be rotated, which could be good for simulating wind blowing of the particles.
  • Particle Rotation 3D - The particles will be rotated in the 3D space around any of the axes.
  • Particle Scale - The scale of the particle can be adjusted throughout its lifespan.
  • Particle Scale 3D - The scale of the particle can be adjusted in 3D throughout its lifespan.
  • Particle Sphere Fader - The particles will fade when reaching the set sphere.
  • Particle Sphere Killer - The particle will die(disappear) when reaching the set sphere.
  • Particle Strip - The particles get stretched in the set direction.
  • Particle Twirl - The particles will be spun around the source.
  • Particle Velocity - The particle will fly away from the source.

Different combinations of the above effectors can be used to create many different particle effects; each parameter can be changed in real-time.

How to Add a Particle System to Your Scene

Adding a particle system is very similar to importing a model to your scene.

Let's say you have a very simple scene that has a Camera, a Plane, and two light sources:

First, you need to add a Particle Source to your scene. Open the Insert Module menu and search for Particle Source.
You will get the following options:

You can use any of them, in this example we will use a Particle Cube Source. Add it to your scene and connect it like so:

- When using Particle Model Source you also need to specify a model that will be the source. You can do it like this:
-
By default, the source is visible with a grid texture, if you wish you can wire any shader into it as detailed here for non-PBR and here for PBR materials.
NOTE: You can also use your own model for more complex sources.
NOTE: You can also turn off the model if you don't want it to be visible but still want the particles to spawn from it. In this case, you do not need to connect any shader to it.

Then add a Sprite Particle module like so:

- If you wish to use an Object Particle instead you can connect it like so:
-
Then you can wire any shader into it as detailed here for non-PBR and here for PBR materials.
NOTE: You can also connect your own models to spawn them as particles.

Select the Sprite Particle module and on the Pin Value window find the Image File property:

Set a desired image file here, we used a transparent image of a raindrop.
After setting the image file particles will start to appear.
You can also change its Size, Rotation, and Color here.
NOTE: You can also change which Layer it is rendered on and the Blending Mode, but unless it is necessary we suggest leaving them at the default value.
After setting the Size, Rotation, and Color you should see some raindrops appearing in your scene every second.

Adjusting the Particle Source

The Particle Source can be used to adjust how often and how many particles appear and how big is the source area.
You can use the Particle Source to position where the particle will appear using the Transformation property:

Let's increase the spawn rate of the particles, to do this find Emit Interval:

This value is measured in seconds, let's set this to 0.1. You should see that now there are many more raindrops on your screen.:

Let's see what other parameters you can set here:

  • Playing, Play, Stop, Clear - You can use these properties to control the emitting of the particle system. Clear will instantly remove all particles then they will start to spawn again.
  • Emitter Lifetime - You can specify how long the Source will spawn new particles, this is also measured in seconds.
  • Max Emit Count - You can set the maximum number of particles that can be spawned.
  • Particle Orientation - The particles will spawn in the set direction.
  • Particle Lifetime - You can set how long a particle is visible, this is also measured in seconds.
  • Particle Life Speed - You can set how fast the lifetime of a particle takes place. This value multiplies the Particle Lifetime value.
  • Inher Velocity Amount - The particle will inherit the velocity of the source. If you move the source the particles will fly in the direction of the movement.
  • Random Seed - The particles are pseudorandomly generated, you can switch between different generations with this property.
  • Pregenerate - Invisible particle will be generated so when the module is turned on it does not have to generate from zero.
  • Shader Index - The particle will only be visible in the cameras that are rendering that same index.
  • Stop When Inactive - The particles will not spawn unless the module is active.
  • Cube Size - You can set the size of the Source cube.
  • Sphere Radii - Radius of the Source sphere.
  • Vertices Only - The particles will only spawn from the vertices and not from the faces or edges of the model.
  • Color Map - Can be used to add further texture to a Sprite Particle.
  • Surface Only - The particle will only appear on the surface of the source and not inside it.

Adding effectors

You can wire any of the above-listed effectors to the particle source like this:

You can also add as many effectors to a single source as you like as shown here:

After adjustments, the particle system could look like this:


Particle System Examples

We have prepared some examples of particle systems as part of the Tutorials content package. You can find them here: Tutorials\Particle System

NOTE: You need to have the Tutorials and Samples package installed.

Article content

Loading
Close
Loading spinner icon
1/10