This tutorial will demonstrate basic functionality of the new DeepAR particle system and will go through the steps needed to create an effect.

For this effect we will be using an 8-bit pixelated heart sprite as a texture for the particles.


Creating a Particle Emitter

Particle emitters are the heart of a particle effect. A particle emitter is a component that controls particles in its swarm, generates new ones, removes old ones and manages the live ones. To create a particle emitter within the DeepAR Studio, use Node → Add Particle Node.

DeepAR Add Particle Node

A particle node is essential for the emitter to work, and a single emitter is attached to it at its creation. One particle node can have one emitter so, if you need multiple emitters (eg. for multi-texture particle effect), you need to add multiple particle nodes to the parent node, which can be of any type. The recommended shader for particle nodes is the default one, Unlit Texture Color Cutoff. Other shaders will generally work, however rendering may appear weird or may not be correct. The default shader is guaranteed to work correctly while some shaders. may not render transparent textures correctly.

For this effect, we will create a single particle node positioned at (0, -22, 50) in camera space with no rotation or scale.

Particle Color & Texture

All particles of an emitter will use the material of its parent particle node. There, you can set all properties that will be the same for all particles of that specific emitter. When using Unlit Texture Color Cutoff, you can set a texture and a color of particles, as well as the cutoff value for correct transparent texture rendering. The cutoff ignores pixels of alpha values below it, and only the red component of the cutoff is used. The default cutoff is 0. If multiple textures and/or colors are needed for your effect, use. of multiple particle nodes is necessary to achieve the desired effect, and it is recommended to leave the depth testing on for those cases so that the generated particles may overlap each other.

We will use a simple 8-bit texture of a white heart and red for color.

White 8 bit heart sprite

Sprite used for the effect

It is important to set the cutoff as well to make sure that transparency in textures is correctly rendered. The cutoff will be set to the following:

DeepAR sugested cutoff for transparent particles.

Recommended cutoff when dealing with transparent particles.

Emitter Type & Size

The size and type of an emitter determine how the particles are being generated and where. There are 4 types of emitters: point, line, plane and volume. The type determined wether the particles will be emitted from a point, line, plane or volume in space. The size will be used to calculate the geometric representation of the shape for generation of the initial position of particles. Depending on the type of emitter, some components of the emitter size vector will be ignored.

We will use the line emitter for this effect of size 40.

Speed & Size of Particles

The speed determines how fast particles will move, using the minimum, average, and maximum values to randomize the speed of each particle. Scale is calculated the same way and determines how big each particle will be. Every parameter set in this way is set using a vector of 3 components [minimum, mean, maximum] and is calculated the same.

We will use the speed [3, 5, 6] and particle scale [0.7, 0.9, 1.2].

Spawn Rate & Lifespan

Spawn rate parameter controls how many new particles will be generated per second on average. Lifespan controls how long those particles are live after being generated. It is ideal to use a lifespan that will destroy particles right after they leave the screen, to increase performance of your effect. When creating effects, be aware that screen sizes change when switching to live view or other devices so make sure to create effects that will be of appropriate size for all platforms and live views.

We will use spawn rate of 13.5 and lifespan [5, 7.5, 9].

Spray

Spray is a parameter that, through its x and z components, controls how much the direction of particle movement will vary between particles. Changing the z component of spray will result in particles changing size over time and is useful when overlapping two emitters to create a multi-texture effect, because this will cause particles to more randomly overlap each other.

We will use [0.7, 6, 0] for spray.

Spin & Tilt

The spin and tilt of particles will determine the rotation of particles. Tilt will set the starting rotation, while spin will change the rotation over time. Both are unique for each particle and randomly generated based on the emitter parameters.

We will use til [27.5, 45, 72.5] and spin [0, 0.5, 1.4].

Linear & Angular Acceleration

To create more natural-looking effects, it is recommended to use acceleration. Linear acceleration will increase the speed of particles by the given vector in global space over time, while angular acceleration will increase spin over time.

We will use angular acceleration of 0.4 and linear acceleration of [0, 1.5, 0].


DeepAR 8 bit hearts particle effect parameters

All parameters of the effect


DeepAR 8 bit hearts particle effect

Final effect

Download the effect and assets here!

Did this answer your question?