Particle Editor

From The DarkMod Wiki
Revision as of 17:54, 18 February 2020 by Stgatilov (talk | contribs) (Fixing descriptions: cycles, time, bunch, count)
Jump to navigationJump to search

Beginners and those who just want to use the already existing particle effects might like to first read Particles for Beginners.

Editing the particles themselves (size etc):

The particle editor in DR is under menu option Entity > Particle Editor

Ptcl editor.png

Note: this article refers to the older Doom3 particle editor, and the editor layout has been updated since. The options do the same things so the information is still valid.

Now to explain a few things. At the top you have the particle name next to "particle", next to it you have new, save, and save as. Now, for easiest editing of particles, load up an existing particle, such as the leaf one in the example, modify it and then use "save as". I will explain a bit more further down.

Firstly, and most importantly, we have material. This is the path to your material; not the image file but the material for your custom leaf. So for example you can see the example above has textures/particles/tdm_leaves_01. If you know the name of your material (for example textures/particles/green_leaves) then you can type that in there and press enter and it will find it by itself showing the changes in the render view.

Now that you can see your custom material we can continue on to the size of the leaves etc.

cycles determines how many times the particle effect will play. Zero value means "infinite number of times". In general, a particle system repeats itself prescribed number of times, and every such time is called a "cycle". The most common values are: "cycles 1" for a single-time effect (e.g. one-time explosion), or "cycles 0" for an endless continuous effect (e.g. rain).

time this is how long one cycle of the effect will last in seconds. If you want to determine the total duration of the effect, multiply this time by the number of cycles it has. For fast effects like fire, smoke, or rain, this is usually about a second. For something lazy like leaves randomly flying around, better set this to something like 300.0 (i.e. 5 minutes). This is large enough so that player does not notice randomly disappearing/appearing particles.

bunching this determines how much the particles tend to bunch together: 0.0 means they all come out at first instant, 1.0 means that they are emitted evenly over cycle time, 0.4 means that all particles come out in the first 40% time part of the cycle. This is not important for a single-cycle particle system. To create a continuous particle effect (e.g. rain), set bunching to 1.0. If you set it to any lower value, then particles will come out in bursts, bunched near the beginning of every cycle. Note: bunching values over 1.0 are not supported and will cause some particles teleport around randomly.

count controls how many particles there are (at any moment), so basically the example shown has 32 particles in total. Obviously the more you have, the more dense the effect is, and the more performance it costs. This is a slider so slide it around as necessary. Alternatively you can input a value into the box and then press apply down the bottom right.


To see the changes you are making, center your camera in the render view on the tree and press F7 and F6. F7 rebuilds everything and F6 enables animations. Leave it in render view and move the particle editor to the side so you can see the render view (to watch the changes you are making as you make them).

Distribution This is where things get a little more annoying. You'll notice 3 check dots - rect, cylinder, and sphere. Realistically you'd want to use sphere, but for some reason the algorithm for distribution in the sphere (at least for the leaves) does not work correctly and you get several particles occupying the same spot, which results in z-fighting and generally looks really bad. Now, the rectangle distribution works perfect; particles are properly distributed and there is no z-fighting, but it's a rectangular shape, but can look ok if not too many particles are used. Another alternative is the cylinder distribution. Cylinder distribution works well but annoyingly enough the particles get distributed only on the walls of the cylinder, which means a hole in the middle, so you need to adjust the particle size and cylinder size so that there is no hole in the middle.

The values to the right are the size values in doom units, so change that to roughly be the size you want the leaves to cover. If you selected cylindrical distribution, don't bother adding a ring value as it just makes it larger in diameter, so leave it at 0.

The offset is the offset from the center of the particle entity. Try keeping the leaves centered on the particle emitter, as Doom 3's light rendering system calculates whether or not to light the particles by checking whether the particle emitter is inside the boundary of the light; if yes then applies the lighting to it, but if not then it leaves the particle unaffected, ID did this for performance reasons.

Random Distribution is just what it says, so you may want to leave that ticked.

Speed leave that at 0 for the leaves as that is the speed at which the particles move away from the center of the emitter.

Size is self-explanatory; it's the size of each particle.

Rotation is rotation speed of the particle and aspect stretches the particle from the center of the emitter. So leave these 2 alone for leaves.

Notice that each of these has 2 sliders. This is for time based particles, so one slider is "from" and the second is "to". This is governed over the lifespan, so for example a particle that has sizes 0 to 50 and a lifespan of 10 would mean that it would gradually increase it's size to 50 from 0 over a span of 10 seconds. So for leaves this means that you leave both sliders at the same value. The other values below the speed, size, rotation, and aspect sliders do various things and you can mess around with them if you wish but they are not useful for leaves.

Now that you know what each value does, just mess around with them until you reach something that looks good.

Saving - Press save as (presuming you modified one of the existing leaf particles) and it will come up with a dialog asking for the particle name. - Enter the name you wish (for example green_leaves_01) and press Click the OK button. - Now it comes up with a path dialog. Browse to the Doom3/base/particles folder (if there is no particles folder create one) and name it as what you want (this is the file name, not the particle name), for example something like "mymap_particles" and then press ok. Make sure you save it into doom3/base/particles as saving it into doom3/darkmod/particles WILL NOT WORK.

[EDIT - Someone check me but I tested this and it does seem you can save it direct in the darkmod/particles folder but if you save it in base/particles then it goes in darkmod/particles anyway. Also note that if you select an existing file it will append it - it does not overwrite but adds new particles definitions to existing files if selected. - Fidcal] Once you save it there you will find the particle file (in this case "mymap_particles.prt") in the doom3/darkmod/particles folder; strange, yes, but it saves it there due to the way Doom 3 mod-loading works.

Now in DarkRadiant you should be able to find your new leaf particle when browsing through the particle list.

Tutorial by Dram - updated by Bikerdude

Particle settings not set by the editor

There are a few tweaks that can be added to particle decls manually, and that can't be set in the editor. See the Particles article for details.