Muzzle Flash

Started by
6 comments, last by middy 19 years, 7 months ago
Well I am a bit puzzled on how I could create such an effect. In most FPS games muzzleFlash are a animated QUAD.like this: This looks good if you stand in front or behind the gun. But it would be invisible from above or below the model. This might not be a problem and I could live with it. Can it be done so it works from above and below?. Perhaps a new longer animated texture???
Advertisement
Easiest appreach would be to either use a simple model representing the flame (like the grenade explosions in quake2), or to use several alpha-textured quads laid in a "cross" to create an illusion of a volumeric flame. This method is commonly used to create trees in 3d games.
Xarragonxarragon@swipnet.se
A small model seems like the best solution.

I could make a simple tube and then a aplha layered texture?,or should the model be shaped like a flame with a reddish texture and some transparency?
A 3D model representing that effect won't look so good.You might want to look for "axial billboarding".You can represent those 5 "flames" I see in the image with 5 textured billboarded quads.Each one of them will always face the camera,but as a whole,they will be a 3D entity that can be viewed from different angles.
how about a cone?
aligned so that the pointed tip is in the gun barrel
and the base end fans out in front

then use that texture of yours on the cone, where you map it to the cone's x and y coords (z is the cone's long axis)

this way from the front it looks just like the normal flash
but from the sides you see it kinda spreading out and forward

Mikeman said what I found to look best back when I was doing this effect. It gives the feel of 3d and looks better than geometry.
I agree that billboarded quad is probably your best bet. If you don't want to do the calculations to make it always face the camera, you can use the ARB_point_sprite extention (or the NV/ATI specific versions). When enabled, it generates texture coordinates for point primatives. This is especially good for performance when you have a lot of particles (such as a particle system) because you only send one vertex per particle instead of 4 for a quad...but in this case, it might just be a matter of simplicity so you don't have to do the math to make it always face the camera (unless you like that type of thing, then go for it!).
W

[Edited by - middy on September 21, 2004 3:32:01 PM]

This topic is closed to new replies.

Advertisement