Emitters
Come here for tutorials and 3d training. The aim is to point out good 3d training sites or methods.

Moderators: Winterhawk99, Mermut, Bannor Bloodfist

Post Reply
User avatar
Bannor Bloodfist
Posts: 1309
Joined: Fri Oct 09, 2009 11:45 pm
ctp: Yes
dla: Yes
TBotR: Yes
nwnihof: Yes

Emitters

Post by Bannor Bloodfist »

Animating Emitters
As explained by Dragonessa of the CTP Team

Animating emitters is fairly straightforward, once you understand the basic requirements. To have animated emitters your model requires two things:

1. A “Dummy Animation Node”
2. Each emitter has a Spawntype setting
3. Each emitter has a “Animation Key” (or “Birthrate Key”)

Dummy Animation Node
The dummy animation node is a “dummy” object that bears the same name as the AuroraBase followed by an “a” – for example, a model named “plc_model.mdl” would have an AuroraBase named “plc_model” and a dummy animation node named “plc_model_a”.

SpawnType
SpawnType defines how the emitter plays its animation. The setting can be found here:

Animation Keys
Click the “Animate” button at the bottom of the GMax window. A red border pops-up around the window you are working in to show that you are in key-setting mode. To set animation keys, click the “autokey” button then choose your birthrate. When the keys are properly set you will see them displayed at the bottom of the GMax window.

Emitters Explained
As Explained by Xahlt on the Bioware Forums (2002)

Someone asked for this stuff and I wasn't sure if anyone had ever posted details on it. This is just my understanding from working with the emitters, so I could be dead wrong on several of these items.

* Emitter Properties*

********************************
COLOR, ALPHA AND SIZE
********************************

Color is controlled by two properties:
colorStart [r] [g] (b)
colorEnd [r] [g] (b)
where r,g,b are red, green and blue in a value from 0.0 to 1.0. (with 0 being black, or no color, and 1 being white or full color). So
colorStart 0 0 0
is pure black
colorStart 0 0 1
is pure blue.

These specify the color of the particle group" over life expectancy. So
colorStart 1 0 0
colorEnd 0 0 1
specifies that a particle group will change from red to blue over the life of a particle.

Alpha transparency is handled similarly.
alphaStart [0 to 1]
alphaEnd [0 to 1]
where 0 is completely transparent and 1 is completely opaque, so
alphaStart 1
alphaStart 0
nicely fades out a particle over it's life.

Size is also handled similarly.
sizeStart [0 to arbitrary value]
sizeEnd [0 to arbitrary value]
the values seem fairly arbitrary and dependent on the effect, so you will have to do experimenting to get them right, although 1 is the standard value. 0 will scale to 0%, however, and the effect won't be visible.

Next there is a control function for scaling the y axis only
sizeStart_y [0 to arbitrary value]
sizeEnd_y [0 to arbitrary value]
note this works differently from the normal size parameters, as 0 simply means no extra scaling on y-axis (i.e. x=y), and 1 = 100% scaling.

Next there is frame control
frameStart [1 to arbitrary value]
frameEnd [1 to arbitrary value]
not really sure what this does as it doesn't seem to affect most emitter types, however I have seen emitters triggered by animation in a model so it may possible control which frames an emitter plays at.

Edit: Bannor Bloodfist; Yes, the above controls when the emitter turns on and off in a given animation sequence. Say you have a waterwheel. Water pours into the top of the wheel, and as the wheel rotates around, it pours out when the bucket tips past a certain point. You can turn the emitter on/off as the wheel is in certain positions. However, this is a very expensive addition to emitters (the waterwheel I mean) and can really reduce your frame rate if the number of buckets (each with their own specific emitter) increases as you would be forced to have multiple emitters (at least one per bucket, likely 2 or more per bucket).

********************************
PARTICLE LIFE
********************************

Next, the rate at which new particle groups are born:
birthrate [0 to arbitrary value]
where any number < 1 will result in no "births". A value of one seems to indicated a birth about every 1/2 sec to me, but I'm not sure how consistent that is (or whether it's affected by another timing scale I'm not noticing)

Next, life expectancy
lifeExp [0 to arbitrary value]
where the value is number of seconds a particle group will "live"

Edit: Bannor Bloodfist; Emitters and their resulting particles CAN cause lag, depending on how many particles are being emitted, and their lifespan. Where possible you should adjust the lifespan so that the particle dies once it meets any outside edge, or bottom of screen. Say in toolset, if you have rotated the view so that you can look underneath the tiles, your particles should not continue to stream below ground, as they are eating up processing and FPS for something that is never seen in game.

********************************
PARTICLE VOLUME AND BEHAVIOR
********************************

First, is mass:
mass [0 to arbitrary value]
where 0 is no mass. This is an interesting control which affects the amount "gravity" will pull on particles. In other words, how much the particles will be pulled down the z-axis over their lifetime. A particle group with no mass will continue forever in the direction of it's velocity vector if this property is given a non-zero value.

Spread:
spread [0 to arbitrary value]
controls the directional variation with which particles are emitted. 0 is a very narrow stream, whereas a high number like 100 would spread particles in random directions.

Rotation:
particleRot [0 to arbitrary value]
where 0 is no rotational speed. This really affects a particle group rotating about itself, creating either a starry effect or swarm type effect depending on the particle.

Velocity:
velocity [0 to arbitrary value]
where 0 is no velocity. Obviously, affects the constant speed at which a particle group travels from it's birth point.

Randomizing velocity
randvel [0 to arbitrary value]
where 0 is no randomization. Allows particles to have slightly (or vastly) different speeds randomly.

********************************
OTHER
********************************
FPS
fps [?]
assuming that this stands for frames per second, I still have yet to get this to affect anything.

XSIZE & YSIZE
xsize [0 to arbitrary value]
ysize [0 to arbitrary value]
this appears to control the areas in which particles can be "birthed" - a large xsize and ysize value result in a large area in which particles can be born. A value of 0 and 0 result in all particles being born from the same point.

Blur length
blurlength [0 to arbitrary value]
obviously this has something to do with blurring, but I'm unable to see any resultant effect.
EDIT: by Bannor Bloodfist; blur affects how an emitted particle merges into/from other particles in the same stream. This can vastly improve the look/feel of a fountain or stream of water. If you have no blur, the particles will appear separated, making the "fountain" appear as if it was generated with some sort of automated cannon instead of a steady stream of water. Note that depending on the rate/speed of this emitter, it may not be necessary.

********************************
RENDERING
********************************
Update
update [Fountain, Explosion, Single]
controls the method by which particles are spawned from an emitter. Single creates one and only one particle - if you choose this, properties such as birth rate become meaningless. Fountain creates a continuous stream. Not sure what explosion does.

Render method
render [Normal, Billboard_to_World_Z]
Normal is (duh) normal. Billboard to World Z essentially flattens the effect along the z axis so it is not visible from the sides, only from top and bottom angles.

Blend mode
blend [Normal, Lighten, Punchthrough]
These modes are identical to the blending modes available in texture files. Normal is normal; lighten lightens the luminosity of the color hues behind it. No idea what punchthrough does.

Texture
texture [valid texture image]
Probably the most important part. A particle with no texture is simply a square - a valid texture image should be an alpha textured tga which describes a sprite-like geometry for the particle.

Grid
xgrid [1 to arbitrary value]
ygrid [1 to arbitrary value]
Appears to control scaling of texture onto particle. 1, 1 results into an even ratio. Higher numbers scale the texture so that only portions of it will fit on particles.

Edit: Bannor Bloodfist; This will typically not matter much as 99% of the time you are working with particle sizes much smaller than the texture assigned to them. But if you are using a large, single, texture to work with multiple different emitters, and that texture has different colors/shapes etc on it, you can pick a specific location on that large texture to be what is actually displayed on the particles in this stream. You can NOT choose different textures for different particles from the same emitter.

These are just my results from experimenting, please let me know if you have a better idea of what these functions do.

********************************
END
********************************
CTP Team Lead

Post Reply