TUTORIAL 4.1 – Particles

Creating particles for HPL is easy and fun much thanks to an advanced but easy to use editor. In this tutorial we will create two different particles. Let's get started

First make sure you have placed the tutorial directory in the redist directory. And make sure that you have added all the tutorial_x directories to the resource.cfg file using HPLHelper.

Now, open the ParticleEditor.exe and what you will be presented with is many tabs with lots of options. To make this as easy as possible, lets add a material to use as a particle and simply see how it looks in the preview window. To do this, select the ”Material” tab, in the file input area click the ”…” button and select the material ”tut_particle.mat” located in ”tutorials/tutorial_4”. This is all you have to do for now, using the File menu and save your particle to your ”mystuff” directory and name it ”mystuff_particle.ps”. You can now click the ”save and view particle system” button.

You should get a window that displays an explosion, for each second it draws a new explosion on top of the old one. Not very fun, but a working particle, lets try and make it slightly more interesting.

Go to the ”Life” tab and change Life span Min and Max to 2 for both. This means that a particle will be rendered for two seconds, if you set different Min and Max values you will get a random effect. Lets move over to the ”Rendering” tab, at the bottom you have Size fading, set the ”start relative size” and ”end relative size” to 0 and leave ”middle realtive size” set to 1. Set ”middle relative start” to 0.1 and leave ”middle realtive length” at 0. Now view your particle system.

You should have an explosion that quickly fades in and slowly out in a pulsating manner. Slightly more interesting. Lets get some random colours for the explosion, go to the ”color” tab.

In General set ”Min Color” to 0 for R, G, B. If you view the particle now you get explosions in random colors. Go to the ”Movement” tab and for Box velocity set ”Min Velocity” to -1 on X,Y and Z. On ”Max Velocity” set X,Y and Z to 1. This will move the particles away from the center start location in random directions and speeds.

Finally lets go to the ”General” tab and set ”particles per sec” to 100, uncheck the ”respawn dead particle option and finaly set the ”Warmup Time” to 0.1. What this will do is it will create 1 burst of parciles, starting 0.1 seconds into the calculation resulting in a colorful pretty explosion.

To make the explosion slightly more interesting we are going to add one more material to the effect. In the General tab, Click Add below the Emitters: dropdown menu.

We now have the abillity to add a smoke particle as well. First go to ”Materials” tab and load the ”tut_particlesmoke.mat” found in ”tutorials/tutorial_4”. To keep the colorful style we will not simply add some smoke, we will add some colored smoke that will start in the center and move away in a sphere pattern creating a shockwave effect.

First lets make it smaller, in Rendering change Min and Max size for both X and Y to 0.2. ”Set End relativ size” to 6 and ”Middle relative start” to 0.2. This will shrink the particle 0.2 and just before the particle disapears it will have grown to 6 times the size.

Go to ”life” tab and change it to 3. Continue to ”Movement” tab and set ”Velocity type” to Sphere instead of box and check the ”uses direction” option. For sphere velocity leave Min and Max X as they are but set Min and Max Y to 0. The last thing on this page is to set both the Min and Max speed to 3. What we have done now is that this particle will spread in a circle out of the center. But currently it is in the wrong direction to be viewed.

To change this go to ”General” tab and change ”