Energy bolt representation

This topic is 3223 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I'm currently working on a small space-like shooter (in the first-person and a 3D environment), and seem to have hit a bit of a snag. In other games of this type I'm sure that I've seen some quite effective representations of "energy bolt"-like weapons - that is, bright "darts" of light - and I would like to include something similar in my game. I've considered a number of options, but nothing yet has seemed to produce the desired effect. Some of the most prominent ideas that I've entertained have been:
• Axial billboards
• The billboard's flatness is fairly apparent at low angles of incidence (such as just after firing), as the billboard rotates only about the axis of its velocity.
• Particle trails
• I find them to not be very effective for representing a cohesive whole, as opposed to a, well, particulate trail.
• 3D geometry
• Slightly awkward to create a blurred edge and internal "glow"; I imagine that it could be done in a shader, but I'd rather not for this project - surely there's a simpler way?
• (Three or six (depending on whether back-face culling is enabled or not) quads aligned with the base axes of the projectile, each textured with an appropriate image and rendered additively.)
• Tends to produce a lobed or rayed effect at some angles of incidence.
I did consider a few other ideas, including a half-bolt constructed in 3D, hollowed away from the player, aligned axially and textured with a fuzzy image, or 3D geometry textured with a fuzzy image and using texture coordinates that are calculated from update to update, but, while the latter might actually work, both seem like overkill to me. I'm currently using the last of the list that I gave above (axis-aligned quads); it's the best that I've come up with thus far, producing a decently volumetric effect and working for a number of angles. That said, I don't seem to recall having seen the lobe- or ray- effect in other games, and so suspect that I might be missing some other technique. Searches have thus far availed me little, but that may well be due to poor keyword selection on my part. Does anyone have any suggestions, and if so, what are they, please? My thanks for any help. ^_^

Share on other sites
I don't remember the correct term nor any links to tutorials on the web, but one way of doing it is using "capped" axial billboards.

Basically you use a billboard but draw additional quads that face the camers at bot ends.

Something like that:
      ___    /|   | _ / |   || |  |   ||_|  |   |   \ |   |    \|___|

The left portion is the far end of the beam, the right one is the near end.

Maybe someone can elablorate a bit more on that and/or provide a link.

Hope that helps.

Share on other sites
why not render a mesh like a cylinder to a render target, blur it and change color then additively blend it over the scene? Then you could get perfect beams that look good from all angles.

Share on other sites
Thank you both for your replies. ^_^

Lord_Evil, your idea looks interesting, and worth exploring - I haven't yet considered it carefully, but I'll probably give it a shot. A quick search of both this site and the 'net didn't turn up any useful-looking links for "capped axial billboard", but I think that I have a sufficiently clear impression at this point - it seems fairly straight-forward.

Matt Aufderheide, that would probably work indeed, but it seems a little like overkill, for my purposes, at least - surely this task is simpler than that?

Share on other sites
I dont see why its overkill, or why it would be difficult..its seems like the easiest to me...

Share on other sites
the method lord evil said is one way
though watch out u must take care of what texture u use for the energy bolt, its a bit of mucking around in an image program

personally though first Ild ignore the two end billboards, i.e. just use the center axial billboard which looks ok in 99% of cases (which may be ok for your needs)

Share on other sites
Quote:
 Original post by Matt AufderheideI dont see why its overkill, or why it would be difficult..its seems like the easiest to me...

Would it still sound like the easiest if you were developing on a GBA? It's doubtful that he's got shader or off screen rendering support and or is Fillrate / memory bound.

Share on other sites
Quote:
Original post by bzroom
Quote:
 Original post by Matt AufderheideI dont see why its overkill, or why it would be difficult..its seems like the easiest to me...

Would it still sound like the easiest if you were developing on a GBA? It's doubtful that he's got shader or off screen rendering support and or is Fillrate / memory bound.

Where does it say he's developing for GBA?

Share on other sites
Quote:
Original post by Matt Aufderheide
Quote:
Original post by bzroom
Quote:
 Original post by Matt AufderheideI dont see why its overkill, or why it would be difficult..its seems like the easiest to me...

Would it still sound like the easiest if you were developing on a GBA? It's doubtful that he's got shader or off screen rendering support and or is Fillrate / memory bound.

Where does it say he's developing for GBA?

It doesn't say it anywhere, but that doesn't make it any less a valid answer to your question.

A more applicable one is that rendering of a cylinder for each and every particle is overkill due to the vertex bandwidth and extended number of draw calls (not all current hardware supports instancing yet, remember). Just because it seems easy to implement doesn't mean its efficient.

(edit, fixed typos. its too early in the morning for me to contribute here while at work)

Share on other sites
the problem with a mesh for a lazer bolt is not cause its overkill
but because its gonna look visually worse, unless u do some fancy shader

see the nvidia developer website IIRC theres another technique (where the use a collection of images for the lazer + then chose which one to use depending on the incidence angle)

Share on other sites
Everyone here is missing the point.

I was suggesting a method for laser beams, not "particles".

The main idea is this:

render a cylinder mesh for a laser beam to a render target. Then you blur this and then additively blend the texture over the scene. Then you get perfect beams with very little work.

Share on other sites
No. Aside from being a stupid amount of GPU work for a simple effect, it has the extra problem that it's not going to sort correctly.

Share on other sites
Sorting can be done using a depth texture which any decent renderer should have available.

Its not "stupid"...modern GPUs should be used. Is it ideal for the original poster? I dont know. He doesnt have to use it.

Share on other sites
Thank you all for your input. ^_^

First of all, my apologies for the delay in my response - I was away from the internet yesterday, I'm afraid. ^^;

As to the use of shaders or separate render targets, surely a geometric solution, perhaps including some form of billboarding, would be simpler than rendering to a separate target, blurring it, and then blending that over the main render target?

I believe that I should have access to shaders and separate render targets; I'm just loath to do so without first looking for a solution that better suits me. ^^;

It also occurs to me that the separate-render-target-and-blurring technique is likely to be slower than geometry-and-additive-blending on at least some cards; while these may not be in the majority any more, might it not be preferable to look for a solution that might work in those cases, if it seems that one should be available?

As to the suggestion of an axis-oriented three-billboard solution, as suggested by Lord_Evil, I've considered it further and have come up with situations in which it seems to me that the illusion should break down, such as from angles of incidence that are too high (in which case the end-pieces should seem to become very thin, until disappearing at 90 degrees). Additionally, I doubt that it would be effective for a bolt that didn't have semi-circular ends (such as one that tapers quite a bit).

Thank you, however - it was worth investigating, at least. ^_^

Quote:
 Originally posted by zedzpersonally though first Ild ignore the two end billboards, i.e. just use the center axial billboard which looks ok in 99% of cases (which may be ok for your needs)

Unfortunately, I've tried that, and, unless I implemented it poorly in some way, I found the flatness of the billboard to be quite apparent to me. :/

Share on other sites
>>
Unfortunately, I've tried that, and, unless I implemented it poorly in some way, I found the flatness of the billboard to be quite apparent to me. :/

yes it is noticable for static stuff but u will find lazers etc move quickly across the svreen thus the player shouldnt notice it (youre looking erhaps through the critical eyes of a developer)

Share on other sites
Well, the end parts of the billboard should always face the user, so even if the user looks at it at 90 degrees you should fully see them (it appears as a circle made of both "end" billboards then).

If the bolt tapers a bit, it shouldn't be a problem to have one end be bigger than the other.
Only around the 90 degree viewing angle the solution might break. In that case you could consider of making the smaller end as big as the bigger one (maybe taking perspective/z-divide into account).

Share on other sites
Quote:
 Originally posted by Lord_EvilWell, the end parts of the billboard should always face the user, so even if the user looks at it at 90 degrees you should fully see them (it appears as a circle made of both "end" billboards then).

Aah, I see - I think that I perhaps missed this the first time. ^^;

Hmm... Well, I still have some misgivings, but I think that I probably will give it a shot, at least.

As to tapering, if the taper is too high (and I tend to prefer tapered bolts to rod-shaped bolts, I think), then at near-to-zero angles of incidence one should see something pointy, rather than the expected round profile, it seems to me.

(My apologies if it seems that I'm "moving the goalposts" a bit in this thread - perhaps I should have been rather more specific about my intentions in the original post, at the expense of risking greater length...)

Quote:
 Originally posted by zedzyes it is noticable for static stuff but u will find lazers etc move quickly across the svreen thus the player shouldnt notice it

Unfortunately, as I recall I did try it in motion. :/

Quote:
 Originally posted by zedz(youre looking erhaps through the critical eyes of a developer)

This, admittedly, is quite possible. ^^;

Share on other sites
look for -> cg volume lines

>>Unfortunately, as I recall I did try it in motion

post a screenshot, in white wireframe on a black background
the best thing to do is run up quickly a little demo app that draws a lazer to screen + then lets u rotate around this lazer looking at it from many angles

Share on other sites
Quote:

That's quite an interesting idea - thank you for pointing me to it. ^_^

Quote:
 Originally posted by zedzthe best thing to do is run up quickly a little demo app that draws a lazer to screen + then lets u rotate around this lazer looking at it from many angles

Heh, I do indeed do that sometimes when experimenting with various energy bolt types - since my game already allows movement in 3D, and has controls that make it reasonably easy for me to fly around the bolt, I just alter the weapon that fires the bolts to create unmoving (or very slow) bolts that last for a long period of time. ;)

As to a screenshot, I may well try to remember to do that on Tuesday (the place from which I'm posting today is going to close soon, I think, and Monday is a public holiday here).

Thank you! ^_^

Share on other sites
(My apologies that this is a double-post; I thought it better to double post and make the update apparent than to risk it slipping by.)

Update:
I think that I've found something that I'm happy with. ^_^

Specifically, what I've settled on is essentially Lord_Evil's suggestion, but with a single billboarded circular sprite in the centre of the bolt rather than two at the ends. The result does produce a single pair of "rays" at low angles of incidence, and a "blob" in the centre near 90 degrees, but I find the latter to be not unpleasing, and the former to not be as disagreeable as two pairs, as I had earlier. Overall, the solution seems to work fairly well. ^_^

Thank you to all who helped! ^_^

Share on other sites
Care to post some screenshots? [smile]

Share on other sites
I'll try to remember to post some tomorrow. ^_^

Share on other sites
And here they are!

(Again, my apologies that this is a double-post; since the screenshots were requested, I wanted it to be clear that something had been posted here.)

(Clicking on the thumbnails should take you to a larger view in each case.)

The texture used in these images is pretty thin, but I believe that it should work similarly well - perhaps even better - for thicker bolts.

Share on other sites
Nice, thanks [smile].