"Static" Trail

Hi



I want to create a trail-like effect for weapon fire (sci-fi weapon fire, but no laser), something between this

http://www.sg1archive.com/forums/uploads/post-9860-1133118833.jpg

and this

http://i386.photobucket.com/albums/oo302/tickleme2/Space/Space-Battle.jpg

I hope you get the idea :wink:



Until now I’m using TrailMesh to get this done. But I think this slows the game significantly down when 10+ ships fire at once their weapons at each other, so you get 20 - 40 trail meshs simultaneously, and each of them moves fast, has collision detection and has to be updated in order to be displayed right. The updating is the thing that annoys me right now, because for my purpose it would be sufficient to have like a static particle (of that shape) that is attached the moving weaponfire-node and thus moves with it, without the need to recalculate the whole thing every frame.

Another bad thing is the fact that the TrailMesh has to be attached to the rootnode, which is again not nice for my purpose.

Do you know any other way to achieve a similiar effect? Of course, I could load an image, put it onto a Quad and attach it to the weaponfire-node. But it shoud be clear that it has to look the quite the same from any angle, which is not possible with loading a simple image.

Any idea?

Sphere with fitting cone on one side.

Yes it can look the same from every angle just with a Quad and an attached image. You can have the Quad Billboard around the axis of the ray and it will look correct i guess.

dhdd said:

Yes it can look the same from every angle just with a Quad and an attached image. You can have the Quad Billboard around the axis of the ray and it will look correct i guess.


This is also not an option, because it must not look exactly the same from every angle, if you think about it.
I guess I try Empire Phoenix's method.
Thanks for you answers!
Wasserleiche said:


This is also not an option, because it must not look exactly the same from every angle, if you think about it.



Me thinks "Freelancer" used a apir of billboards - one normal one for the "head" of the discharge, and an axis aligned one for the tail. The tail bb started at the centre of the head, went out to the end of the tail, and then was oriented to that it's sides were perpendicular to the camera. The shaders would have to add-up the colours but I think it'd solve your angle problem and be cheaper than cones ....

Axis Aligned Bill Board - http://nehe.gamedev.net/data/articles/article.asp?article=19#5

I once saw a good idea on game dev about laser beams, but i can't find the link anymore.



The idea was to combine 3 quads with the images mapped like that :

    | /

    --|--                   

    / |

face view



don't know if that's very clear…but it allow to rotate around the beam and trick the viewer.

Adding a bloom should enhance the effect

grigorii.pechorin said:

Me thinks "Freelancer" used a apir of billboards - one normal one for the "head" of the discharge, and an axis aligned one for the tail. The tail bb started at the centre of the head, went out to the end of the tail, and then was oriented to that it's sides were perpendicular to the camera.


I don't know if I understood you correctly. I just did some experiments with BillboardNodes and Quads, but the only thing that makes sense at all is SCREEN_ALIGNED, but of course it looks awful because you just have these ugly quads flying around.
I didn't understand how to align the Billboard to the direction the weaponfire is headed especially I don't see how to use the BillboardNode class to align to a specific vector. Maybe you could explain a litte bit more :)
Thanks for your answers again!

Some gamse like x use kinda quads layout like



x  (front view)





and a o shoped in the head of the bullet so you see something with solidity from frontal,

however since rendering one single convex object without transparence (or even with) should be faster than rendering some planes with transparency.  Actually In jme2 at elast I had serious clipping issus before I changed to the sphere cone type, wich looked almost identicall.

Empire Phoenix said:

Actually In jme2 at elast I had serious clipping issus before I changed to the sphere cone type, wich looked almost identicall.


Well, I tried this now and it just looks awfull *g*. Of course I don't know how you exactly implemented it, but I don't think I will use this.
At the moment it looks like I'll have to stick to the TrailMeshes, because they still look better than all I tried.

The axis aligned billboard just aligns the quad to spin on it's axis so as to present width to the viewer, while locking it's direction. Pretty much what trail mesh does I guess although you don't need all the trail functions.



I used the idea for my lasers and was pretty happy with the effect. Used simple cylinders for tracer fire but they didn't look great. Problem with convex shapes is how you texture them to look right from any angle. Intersecting quads usually are ugly imo.

Until now I'm using TrailMesh to get this done. But I think this slows the game significantly down when 10+ ships fire at once their weapons at each other, so you get 20 - 40 trail meshs simultaneously, and each of them moves fast, has collision detection and has to be updated in order to be displayed right.

I didn't think something like that would be slow. Did you try profiling the code? Are the slowdowns due to the collision detection?