Sandbox 2 Manual
ContentsIndexHome
PreviousUpNext
How to add more details to a Particle Effect

How to add more details to a Particle Effect

 


Overview

After creating simple 2D particles this tutorials focuses on adding more details to existing particles. To get started load your fire particle from the 1st part to follow the walkthrough below. 

Adding more particles to the effect

Adding child particles

Every particle can have child nodes, and these can be triggered by the parent effect. 

First make sure the particle Fire1, which you created in the previous particle tutorial, is selected in the particle editor. 


Now click on the Add Sub Effect button to make a child node. 


Right-click the child node and rename it to "Spark1". 


Setting up sparks

 

Select Spark1, then go into the Appearance pane, and turn on Orient To Velocity, set the Texture to spark_stretched_mono.dds and set the Blend Type to Additive

In the additional parameters of Texture Tiling, set Tiles X and Tiles Y to 2 and Variant Count to 4

Note: 

You may have right-click your entity and click Reload Script in order to see visual effect. 


Using a random frame in an animated particle

 

This sprite is made to be used as an animated texture. To create an animated texture yourself, prepare a tiled texture like the one shown. The animation frame order starts at the top left corner, continues to the right, and ends at bottom right tile. 


The resolution of each tile must follow the general rule of texture creation in the CryEngine2, i.e. it has to be a multiplier of 16. 

In this case, you set the Variant Count instead of the Anim Frames Count, so, on spawn, the sprite texture will be randomly picked from one of the 4 tiles. 

Spawning your sparks

 

Go to Emitter pane and turn on the Continuous switch, set Count to 30, set Particle Life Time to 0.5 and set Particle Life Time Var Random to 0.5


Go to the Lighting pane and set Diffuse Lighting and Diffuse Backlighting to 0, set Emissive Lighting and Emissive HDR Dynamic to 3 and set Alpha Var Particle Life curve as shown. 


Interpolation types in the particle graphs

 

Next, select the end point of the curve, then put the mouse cursor in to the graph area and press the SPACE key. This will change the point’s interpolation type to linear. 


Adding color to your particle

At the moment, this texture has no color so let's add some. Open the advance properties of the Color pane. 


Double-click the left edge of the Color Var Particle Life bar... 


…and the color selector will pop up as below. 


Select a bright orange color then press OK

Double-click the right edge of Color Var Particle Life bar. 

Make a new point and set it to dark orange. The Var Particle Life bar should look as shown below. 


Altering the size of your sparks

 

Now, go to the Size pane and set it up as shown: 


Go to the Spawning pane and set Random Offset X and Y to 0.5


Spawning/Random Offset boxes adds a random offset to the spawning point of the particle from the emitter’s axis. 

Next, turn on the Second Generation switch. This makes sure spawned particles are triggered by the parent particle. Every time Fire1 spawns 1 sprite, Spark1 triggers, to spawn up to a maximum 30 sprites. 

When second generation is turned on, the Inherit Velocity value will affect the Second Generation particles movement. This is the percentage of velocity that a child particle inherits from the parent particle at emission time. Try increasing this value, and see how it affects the movement of your particles, and save it if you like it. 

Be sure to save your scene before go to next step. 

Tweaking the particle’s movement behavior

 

Go to the Angles pane and set Emit Angle to 45, Emit Angle Var Random to 1 and Rotation Rate Z to 20


Go to the Movement pane and type in the settings indicated below: 


This time, you set a negative value for Gravity Scale. This means particles will not fall to the ground, but rather fall to the sky. 

Turbulence Size, and Turbulence Speed adds simple turbulence movement to particle. The Turbulence Size value controls the amount of turbulence the particle is exposed too, and Turbulence Speed controls the speed of the particle moving along the turbulence path. Play with higher or lower values of these parameters to get a good understanding of how these values work. 

Testing your particle in different times of day

 

Open the Time Of Day window from View/Open View Pane/Time Of Day


Turn on the Force sky update switch and drag the slide bar to around 22:30 as shown below: 


The scene will now become dark, so you can check out how your effect looks at night time. 


From this image, it seems like the particle is glowing too strongly at night. To counter this, decrease Emissive Lighting, Emissive HDRDynamic and Alpha value

You should always test your particle by switching between day time and night time and tweaking values, to make sure it looks good at all times. 

Making your fire look more realistic

Setting up an animated texture

To make the fire appear even more realistic, you can change it to an animated texture. 

Change the Fire1 settings to as shown below. Use the texture textures/sprites/fire/large_animated1.dds


Also, be sure to set the position as shown below: 


Adding smoke to your fire

 

Select Fire1, create a child and rename it Smoke1

Setup Smoke1 as below. Use the texture textures/sprites/smoke_white_tiled2.dds


Now, repeat the earlier steps: 

In the Emitter pane, turn on Continuous and change the Count to an appropriate value. 

In the Lighting pane, set up the Alpha value and Var Particle Life curve. 

In the Angles pane, set up Rotation Randomization

Also, remember to Reload Scripts on your selected particle, should you not see changes. 

Adding a glow round the base of your fire

 

Select Fire1, create a child and rename it Base1. This will be a particle that will spawn around the base of your fire, and as such, should not raise up. Set the movement speed to a very low value to reflect this: 


Setup Base1 as below. Use the texture textures/sprites/radialfire2.dds


In the Emitter pane, turn on Continuous, change the Count to an appropriate value. 

In the Lighting pane, set up the Alpha value and Var Particle Life curve. Also, tweak Emissive Lighting and Emissive HDRDynamic if you would like to. 

In the Angles pane, adjust the Random Rotation Rate

Also, remember to Reload Scripts


Useful information

Loading and using other libraries

 

Click the Load Library button at left top of the Database View


A browser window will open, from which you can select a different library. 

You can switch between libraries by selecting them from the library drop-down menu. 


Copying and pasting particle attributes

 

You can copy and paste between libraries by right-clicking within the pane and selecting either Copy Category or Copy All


You can Paste using the same menu. 

Applying a material to a particle

 

You can apply materials to the particle. For example, if you select a refractive material, it will apply refraction to your particle. 


Clicking the Browse Material button will open the Material Editor. Select a material from there, then go back to your particle in the database view. Now, click Assign Material

Copyright © 2008 Crytek GmbH. All rights reserved.