This is a continuation of the Creating a Simple Particle Effect tutorial that focused on creating simple 2D particles.
After completing this tutorial you will be able to add more details to already existing particle effects.
To get started, load the fire particle that you created in the first tutorial.
Every particle can have child nodes that can be triggered by the parent effect.
First, make sure that the particle Fire1, which you created in the previous particle tutorial is selected in the Particle Editor.
Now click the Add Sub Effect button to make a child node.
Right-click the child node and rename it "Spark1."
Note: You may have to right-click your entity and select Reload Script in order to see the visual effect.
This sprite is designed for use 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 CryENGINE. It must be a multiplier of 16.
In this case, set the Variant Count instead of the Anim Frames Count, so that on spawn the sprite texture will be randomly picked from one of the 4 tiles.
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. Then set Emissive Lighting and Emissive HDR Dynamic to 3.
Go to the Appearance pane, make sure that Orient to Velocity is selected and that the blend type is set to Alpha based. Set Alpha to 1, and then set the Var Particle Life curve as shown below.
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.
At the moment, this texture has no color so let's add some. Open the Appearance pane and scroll done to the color property. Double-click the left edge of the Color Var Particle Life bar.
The color selector will come up:
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 like this:
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 going to the next step.
Go to the Angles pane and set Emit Angle to 45 and the Emit Angle Var Random to 1.
Go to the Rotation pane and set the 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 move upwards 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.
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.
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:
Select Fire1, create a child and rename it Smoke1.
Set up 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.
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:
Set up 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. It is also possible to tweak Emissive Lighting and Emissive HDRDynamic.
In the Angles pane, adjust the Random Rotation Rate.
Remember to Reload Scripts.
Select Fire1, create a child and rename it to Haze1. This will be a particle effect attached to the flames to create a refractive heat haze effect.
Set up Haze1 as below. Use the texture textures\sprites\fire_blur1_ddn.dds
.
Click on the material selection and choose a refractive material, such as Materials\particle\refraction_muzzle
.
Change particle size, stretching, count, life time as you like. Also, adjust random rotation angles on the Z-axis to your liking.
In the spawning pane, check the second generation box to create particle emitters that are relative to the parent particles.
Don't forget to reload scripts on your particle entities. You can check this effect by placing it before other geometry so the refractive disturbing becomes visible.
You can also achieve a heat haze effect with the settings below.
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.
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.
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.