Particle Surface Emitter
Particle Surface Emitter - Burning an Oil Barrel
In this tutorial we are going to create an oil barrel on fire. It is expected that you have knowledge of static assets before starting this tutorial.
Step 1 - Create or Select a Texture
Make the texture. By making it a 512 x 512 texture and dividing it up into 4 quadrants we can get some variance out of it. We will do this by emitting a different quadrant every time a particle is born. Once you have created your texture upload the texture using the repository browser. There is a default location for particles in the clean engine folder. However you may place particle textures where ever you like.
Step 2 - Create a Static Asset
Create a static asset to use or preferably use oil_barrel_black.gr2 located here \Engine\CleanGame\Resources\tutorials\oil_barrel_black.gr2.
Step 3 - Create a Particle Spec
Create a new local particle spec by going to the main menu Create\particle\NewParticleSpec\local
- make the emitter type as emitter MESH
- under particle, leave it as billboard point and choose the fire 01.dds as the texture to use.
Step 4 - Add an Instance to the Area
Make an instance of the particle in the area via the create menu or the asset panel. You will not see anything yet because we still need to assign a mesh to the emitter. On the emitter property sheet of the new particle, under the emission section and the property MeshFileName, choose the option box. This will bring up a dialog to navigate to the mesh file,\Engine\CleanGame\Resources\tutorials\oil_barrel_black.gr2.
Step 5 - Tweak Properties
Adjust emitter and particle properties
On the emitter property sheet
- Set EmitFrequency to 0.01
on the particle property sheet
- Set Bouyancy to 1.1
- Set the TextureNumber to use all 4 quadrants (TextureNumber = 15)
- Set XScale2D to .25
- Set YScale2D to .25
- Set the Size2D to a timeline where the scale gets smaller over time
- Adjust the diffuse color to be a timeline such as in fig 1 so that the fire can fade out over time.
Step 6 - Add Static Asset
Now add the oil barrel asset and parent the emitter to it. From the create menu or asset menu load up the Oil_Barrel_black.gr2 located here. /Engine/CleanGame/Resources/tutorials/oil_barrel_black.gr2 Note that this is the same asset that we are using as the emitter.
- Add an instance of it to the world via the create menu or asset panel.
Now parent the emitter to the oil Barrel and rest the transforms to 0,0,0 so that the emitter sits on top of the oil barrel. Now we have a burning oil barrel.