Overview

Initial Setup

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.

A Simple Particle Fireworks

This tutorial will teach how to create a simple fireworks effect using particles. It covers usage of second generation child particles and requires you to have at least read and understood the previous fire tutorial.

Creating the Rocket

In the DataBase View, create a new particle item Firework1 in the group Fireworks. This will be the fireworks rocket soaring up into the sky.

Set some basic information like particle count and life time. (Preferably choose some small values to be able to see one firework after another).

In the appearance pane, select a geometry and a material for the rocket, e.g. objects\weapons\rockets\sidewinder\sidewinder.cgf and Materials\presets\materialtypes\clean\mat_wood.

The rocket will not fade away, so the basic lighting settings should be just fine.

You can add some little randomization to its size or stretched length.

In the movement pane, set speed, air resistance and acceleration to your liking. Speed should not be set too high if you wish to actually see your effect.

Also set the emit angle in the angles pane.

Now place the effect somewhere on your map and have look at the soaring rockets.

Adding Trailing Sparks

This will add trailing sparks as second-generation child particles (i.e. local) to the rocket.

So, add a sub effect and rename it to TrailSparks. Change its settings as in the screenshot below.

In the appearance pane, set the particle texture to textures\sprites\sparks_multi_tiled.dds and color blending to ColorBased. Then adjust the particle's texture tiling to fit the texture.

In the lighting pane, zero out the diffuse lighting term and change the emissive lighting terms to 1. Also adjust the alpha to fade out at the end. You can also change the particle's color fading to match the desired effect.

Since the texture chosen above is a little too huge for some small particles, change the particle size to 0.01. If desired, you should also adjust the stretch values.

Now, the important part: in the spawning pane, check the Second Generation box. This will create an sub-particle emitter per parent particle.

To have the sparks trail behind the rocket, set a negative speed in the movement pane. Also set gravity scale to 1 for a more realistic trail. Adjust air resistance and turbulence to your liking.

Since the trail should come out of the rocket's center, choose a small emit angle in the angles pane.

Finally, to make the particles bounce if it hits the ground, change the physics type to SimpleCollision and check the Collide Terrain box. Also choose some small bounciness as seen below.

Reload scripts and admire your fireworks.

Adding the Explosion

Now comes the really important part, the explosion.

For the explosion to look realistic, you need to emit many particles for each rocket.

Input the settings below for the emitter pane.

This will spawn about 5k particles at a given time (delay) and only once per rocket (continuous is unchecked).

Choose an additively blended texture in the appearance pane, e.g. textures\sprites\sparks_multi_tiled.dds.

Adjust the alpha fading curve in the lighting pane, and also, set the emissive lighting values to something about 3.

In the size pane, adjust size to 0.1 and stretch to 0.4. Also, add a trail as shown below.

The particle effect is also a second-generation child effect. So check to box accordingly in the spawning pane.

In the movement pane, set speed to about 10, air resistance to 0.2 and some turbulence speed.

In the angles pane, set the emit angle to 180 with a random variation of 1.

That's it. Now save, reload scripts, and enjoy your fireworks.

As a Practice Exercise

  • Add even more sparks as second generation child to the explosion particles.
  • Put the fire and fireworks together to have a big explosion. Call this effect DeadlyFireworks.

You don't have to create every effect by hand. You can simply copy and paste effects inside of The DataBase View.

 

 

 

Use the Advanced Property settings in the Particle tab to create realistic fireworks effects.

创建烟花粒子特效

初始设置

加载并使用其他函数库

单击 数据库视图 左上角的 *加载函数库*按钮。

 

将会打开一个浏览器窗口,您可以从中选择不同的函数库。

您可以从下拉菜单中选择函数库,并且所选函数库之间可以相互切换。

 

复制和粘贴粒子特性

在窗格内右击,选择*复制类别*或*复制全部*可以实现函数库之间的复制和粘贴。

 

您可以使用相同的菜单进行*粘贴*。

将材质应用于粒子

您可以将材质应用于粒子。例如,如果选择一种折射材质,则该材质将会把折射应用于粒子。

 

单击*浏览材质*按钮将会打开*材质编辑器*。从中选择一种材质,再返回至数据库视图中的粒子。现在单击*指定材质*。

简单烟花粒子

此教程将教您如何使用粒子创建简单烟花特效。该教程包含第二代子级粒子的用途,要求您至少阅读并理解了先前的火焰教程。

创建火箭

在*数据库视图*的 Fireworks 组中创建一个新的粒子道具 Firework1。这将是飙升至天空的烟花火箭。

设置一些诸如粒子计数和使用期限的基本信息。(最好选择一些较小数值,使用该数值能够看见一个又一个的烟花)。

在*外观窗格*,选择几何体和火箭的材质,例如,objects\weapons\rockets\sidewinder\sidewinder.cgf 和 Materials\presets\materialtypes\clean\mat_wood。

火箭将不会逐渐消失,因此应该对基本光照进行精确设置。

 

您可以添加少许随机操作至其大小或拉伸长度。

 

在*移动窗格*,设置*速度*、*空气阻力*和*加速度*至链接。若您想要看到真实的效果,不应设置过高的速度。

在*角度窗格*中也应对*发射角度*进行设置。

 

现在在贴图的某处置入特效并观查飙升的火箭。

添加拖尾火花

这将作为*第二代*子级粒子(即本地子级粒子)添加拖尾火花至火箭。

因此,添加*子特效*并将其重命名为 "TrailSparks"。按照以下所示的屏幕截图更改其设置。

 

在*外观窗格*,分别将粒子纹理和颜色混合设置为 textures\sprites\sparks_multi_tiled.dds 和 ColorBased。再调整粒子的纹理重复拼贴以适应该纹理。

光照窗格,将漫反射光照置零并更改放射性光照为 1。调整 alpha 为最终淡出。也可更改粒子淡出的颜色,以匹配所期望的效果。

 

由于以上所选纹理对于一些微小粒子来说稍过大,因此要更改粒子大小为 0.01。如有需要,也应调整拉伸值。

 

现在,重要部分是:在*再生窗格*,选中*第二代*复选框。这将会使每个父级粒子创建亚粒子发射器。

 

若要在火箭后侧设置拖尾火花特效,请在*移动* *窗格*中设置*逆*速。也可将重力大小设置为 1 以获取更逼真的拖尾效果。根据您的需要调整空气阻力和扰动。

由于拖尾火花应从火箭的中心位置喷出,因此要在*角度窗格*中选择*小发射角度*。

 

最后,若要制造粒子触击地面时的弹跳效果。需将物理类型更改为 SimpleCollision 并选中 碰撞地形 复选框。也需选中一些以下所示的微小弹力。

重载脚本并欣赏烟花。

 

添加爆炸特效

现在进入非常重要的部分:爆炸特效。

若要实现逼真的爆炸特效,每个火箭需发射众多粒子。

在*发射器窗格*中输入以下设置。

 

在既定时间(延迟)内,此操作将产生约 5k 粒子并且每个火箭仅产生一次。(*未选中*连续)。

在*外观窗格*中选择附加的混合纹理,例如 textures\sprites\sparks_multi_tiled.dds。

在*光照窗格*中调整 alpha 衰减曲线,并设置*放射性光照*数值,如设置为 3。

在尺寸设定面板中,调整其尺寸为 0.1 并拉伸至 0.4。添加如下所示的拖尾火花特效。

 

粒子特效也是*第二代子级特效*。因此在*再生窗格*中选择相应的复选框。

在*移动窗格*,设置速度为 10,空气阻力为 0.2 并设置扰动速度。

在角度窗格,设置 180 度的*发射角度*并将随意变化值设为 1。

 

结束设置,现在可以将其保存,重载脚本并欣赏烟花效果。

 

作为操作练习

 

 Note 不需手动创建每一个特效。仅需在 数据库视图中复制粘贴该特效。