Smoke Gets In Your Eyes

Published September 15, 2005
Advertisement
Smoke Gets In Your Eyes

Well, the host is back up, so the pictures are back as well.

Today I spent a few hours fixing up the smoke effect. It's been in there for over a year, but only recently have we decided to
really emphasize the particle effects more, so I started bringing the particles up to date in several areas, starting with the smoke.

The Ancient Galaxy Engine doesn't have a custom particle editor, and is not completely data-driven with respect to particles. Instead, I struck a compromise between artistic tweakability, performance, and customizability.

Many types of particle systems can be modelled in a very uniform manner, with just different parameters, including things like color, texture, particle shape ( triangle, quad, sphere, etc. ), velocity, randomness, lifetime, etc.

However, to do a world-class version of certain particles, you will inevitably need custom code to handle it. An example is water droplets. If they fall on a hard surface, perhaps they should leave a wetness decal behind. If they fall on liquid, maybe they create a splash or more droplets.

So, I have a standard class for each type of cluster of particles. A cluster is a group of particles that is created together, and often represents a bunch of particles that were
created simultaneously. The particles are created, and culled on a cluster by cluster basis. If the cluster's AABB is within the frustum, then each particle in the cluster is simulated with physics & collision.

Each particle cluster class has an associated section of the particles.txt configuration file which specifies tweakable parameters, like initial & final particle sizes, gravity factor, wind factor, lifetime, etc.

Sparks and rocky debris have their physics handled via raycasts, so they use a cheap version of physics, but they do correctly bounce off of all world geometry.

Smoke responds to wind, and rises and expands over time. Each smoke particle is physically a sphere, but drawn as an aligned quad. I was using triangles instead of quads, but they were more obvious when they intersected, so I switched today. The smoke sphere's radius expands over time, which was causing some issues in the collision. I switched from raycasts to a cheap sphere collision model, but was still having occasional problems.

It was possible for some smoke particles to get inside of walls, instead of hugging them. Turns out it was one of the randomness parameters causing this problem. Basically, when laser bolt hits the world, it shoots out sparks, smoke & debris, all created at the collision point.

The position_spread paramter from the text file specifies over how many meters the particles should spread themselves upon creation. Clearly, this should be zero to guarantee a lack of artifacts, because you could end up putting the particles slightly inside the wall where the bolt collided. Once I set this to zero, and changed the smoke sphere collision to use the same collision model as my normal physics spheres, and made sure the collision bounds included both the old & new sphere positions with the radii, all of the embedded smoke issues went away. Whew!

I must say that this is some of the best smoke I've ever seen in real time - it responds to wind, static geometry, and doesn't visually intersect walls or floors, etc.

Later, I may extend it to respond to characters or other movable actors as well.

Here are a few shots of the latest smoke, although it looks way better in action :





This shot shows the smoke conforming to the geometry. The smoke began a bit to the right of the wall opening, at the wall base, right near the debris. Note how the smoke responds to the north-easterly wind and flows through the opening in the wall....



Previous Entry Host Issues
Next Entry Up In Smoke
0 likes 1 comments

Comments

jollyjeffers
Sounds and looks as impressive, but then again I (we?) have come to expect no less [wink]

I'll be betting that they look a whole lot more impressive animated than as still images [grin]

Do the particles cast shadows at all? that'd rock!

Jack
September 16, 2005 09:04 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

1.2 Almost ready...

1112 views

Sound Paths

1331 views

Stately Progress

1133 views

State Lines

1283 views

Pulsing

866 views

Return to The Ship!

1007 views

Cameras & Boxes

1124 views
Advertisement