31 March 2006

Bomb effects



Here are some experimental bomb effects. For lighted or 'glowing' effects I'm using the glBlendFunc(GL_SRC_ALPHA,GL_ONE) blending mode. Because of how the particles add together, you can use fewer of them to create an impressive effect.

This dirt exploding effect, for example, uses the glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); blending function. I shaped the different pieces by creating a texture with 16 different shapes and specifying the texture coordinates based on the index of each particle. This means every 16 particles the shapes cycle, but it's not noticeable since they're not close to each other. Because the particles are small, it takes a whole lot of them to begin to look like something.

30 March 2006

Exploding Particles

Mostly just because I get off on screenshots, but also because these are demonstrative of how a feature evolves, I have some imagery of explosions. These are specifically ShipExplosions, and are intended solely for when a ship is shot down and crashes into the terra. They're still not done, but I'd say they're pretty darn close to being good enough for beta max.

This first one basically is just a bunch of particles spewn out, and even looks kinda boxy. Be sure to generate in a spherical fashion!

The shape is pretty slick and the blending in the middle looks cool. The spots around the edges look a little off.

Here you can see dynamically created clusters.

The basic idea from a distance, with some billowing smoke thrown in for good measure. I think the blending between the smoke and the explosions needs some work.

14 March 2006

Shield Rings


Here's a cool graphics effect I've been working on lately. When a projectile hits the shields on a ship it causes a subtle ripple effect at the point of collision. To do this I had to solve a few problems.



The first is how to store the collision point. The collision occurs at the projectile's world coordinates at impact. These points are converted to ship relative vector using the inverse rotation matrix of the ship. Apparently rotation matrixes are magical in that their inverse is just their transpose, which is nice because it's a lot easier. Then at render time the point is converted back to world relative coordinates using the latest ship rotation, so the the rings actually move/rotate with the ship, as if they're a temporary part of the shields. If you have any real world scientific data on the effects of motion on death ray particle shields, be sure to email it to me.

The second problem is finding the angle to display the rings at. I decided I wanted the rings to always move outward perpendicular to the center of the ship. To do this I compute the vector from the center of the ship to the collision point, normalize it and find a perpendicular angle using this:

Vector perp(out.y - out.z, out.z - out.x, out.x - out.y);

I find the third perpendicular vector by taking the cross product of these two angles.
Vector perp2 = perp.cross(out);

Now I can use perp and perp2 as the two directions to stretch my ring into. Rocking good times.

01 March 2006

rrrrrooocket!

I just finished the next revision of the Rocket AI and it's pretty decent. I can opt for the missiles to be aware of their minimum turning rate or not and they're pretty good at tracking any stationary target not near the ground.

I also added the white trail smoke which looks pretty hot. It's currently using a shiiteload of particles which I need to trim down, and they are generated from the center of the projectile, not at the tail, which looks a little off.