Third Person Muzzle Flash

Blitz3D Forums/Blitz3D Programming/Third Person Muzzle Flash

Gabriel(Posted 2007) [#1]
A muzzle flash for a FPS is relatively straightforward. The perspective is fixed, so you can pretty much just glue a sprite to the end of your gun and your golden, but not so much in a third person perspective. I'm wondering if the best way is to billboard around a local axis to point at the camera, or whether it's better to construct a simple funnel shape with the end chopped off or what. I've seen it done both ways, and I'm not particularly certain what the best approach is. I'm pretty sure particles are a bad idea, because they're wasteful on performance and impractical to generate fast enough, but beyond that, not really sure.

Any other tips to make the effect look good would be appreciated too. I've never done muzzle flashes in any shape or form, so I don't know whether I should be playing with scale and/or alpha or anything else.


cash(Posted 2007) [#2]
when you create your TP model,put a joint on the tip of the gun.
use

shot=findchild(myman,"jointname")

find the x,y,z of this shot and momentarily position your sprite there when the man shoots.


big10p(Posted 2007) [#3]
I dont think that was the info Gabriel is after TBH, cash. :)


Vertigo(Posted 2007) [#4]
I would suggest using two quads in a diamond shape at 90° to one another. Like the spade of a spear. The fat end closer towards the barrel of the gun. Simply place an alpha texture map on it... when it fires, give it 3 "frames" in which you scale the quads outwards. Make the pivot axis of the quads at the tip of the gun barrel so it always goes outwards. With these quick flashes it would look pretty good from just about any angle.


Vorderman(Posted 2007) [#5]
I'd just use a cross of two polys (making an X shape from the front) with a third poly perpendicular across the back near the muzzle.

Put an alpha additive muzzle flash texture on the two crossed polys, as the flash would appear from the side, like this :


On the third poly put an additive texture of a round muzzle flash, as it would appear straight on, like this :


Then make it visible for a frame or two, probably using the alpha setting for smooth on/off transition. You can rotate it randomly down the barrel-axis also to make each frame appear different.


Gabriel(Posted 2007) [#6]
Thanks for all the suggestions. In the end, I decided to go with something quite similar to what Vorderman suggested, except that I've actually used half a sphere for the cross section instead of a third plane.

It was a little tricky to get them rendering perfectly, as the crossed alpha-blending planes were producing a few artifacts, but by disabling depth-writing and z-sorting correctly, it seems to be working quite nicely now.

Thanks again.


boomboom(Posted 2007) [#7]
Anime Shooting Babes?


Vorderman(Posted 2007) [#8]
It was a little tricky to get them rendering perfectly, as the crossed alpha-blending planes were producing a few artifacts


If you're having z-fighting issues make them additive only, rather than using the alpha channel. Flares and flashes typically look best as simple additive materials.


OrcSlayer(Posted 2007) [#9]
From personal experience, I'd say the best way to do a muzzle flash mesh is a combination of a cone and a pair of quads, properly textured it seems to be the best looking method there is. It also seems most commercial games do this...I tried it a while back and it looked just as good in Blitz as anywhere else.