Projectile representation and axial billboards

I’m currently (amongst other things) trying to create a convincing “energy bolt” weapon effect - something along the lines of the bright, fuzzy-edged “pulses” that seem to often be used in space-combat games to represent energy weapons.

Making them seem to glow is easy enough, I find - an appropriate texture, depth writing off, assignment to the “unsorted” bin and additive blending employed do the trick well, to my eye.

More problematic for me at the moment, however, is the shape.

I’ve tried a six-quad approach (three would likely suffice, but I didn’t bother to disable back-face culling at the time), and while it works to some degree, from a number of angles the projectile takes on a “star-like” appearance, with the low-angle-of-incidence quads devolving into near-rays.

I also had a shot at axial billboards; I have my doubts about their appearance at low angles of incidence, but they seemed to be worth a shot. However, I don’t seem to be getting them to work - specifically, if I recall correctly, my attempts seem to work happily when I specify (0, 0, 1) as the up-vector, but not when I specify (0, 1, 0) instead (I want to have them rotate around their direction of motion, and (0, 1, 0) makes a reasonable test of that for now). The best result that I’ve had thus far, I think, has had the projectile oriented in a single direction, not rotating visibly as one moves around it, but nevertheless being visible from the other side, suggesting a near-instant flip or turn as one moves to that other side.

I could use a 3D model, but without applying a post-process effect of some sort (such as, perhaps, rendering to a less-than-screen-sized offscreen buffer and then rendering that at full screen-size to produce a blur) the result seem to me to be likely to be hard-edged and probably dull.

Finally, as I was working on this post it occurred to me to perhaps try an axially-aligned half-projectile, with a fuzzy-edged texture applied to it; as a half-projectile it might look better at low angles of incidence.

So, I thus have two questions:

  1. Does anyone have any suggestions for producing a convincing “energy bolt” effect, and if so, what do you suggest?

  2. Before I clog up this post (further ^^; ) with a detailed description of the NodePath structure of my projectiles, does anyone have any suggestions as to what might be the problem might be in my application of axially-aligned billboards?

I think that I’m currently using the “make” method of BillboardEffect, specifying that they should be axially-aligned but not eye-relative, and giving either the current player NodePath or that of either base.cam or base.camera as the lookAt NodePath.

My thanks for any help. :slight_smile:

PS: I’m still using 1.5.4 at the moment, I believe; I’ll only likely get around to downloading 1.6.0 (or .1 if it’s out by that time) once I have my home internet connection set up, I think.

I don’t know what might be wrong with your billboards. Sounds like it ought to be working.

Another thing to try is the Rope class, which can do a billboard-like rendering of a curve (or, in your case, a straight line) that always rotates about the curve’s own axis.

David

Hmm… Perhaps it has something to do with my perhaps slightly convoluted hierarchy where weaponsfire is concerned.

Allow me to explain:

First of all, as a descendant (if I recall correctly) of my “MovingObject” class, weaponsfire objects have a “manipulator” NodePath that is intended to control position and orientation. It is here that the object’s direction is set, as I recall.

However, to allow for such things as weapons that spiral about a central axis as they travel, I have a second, offset NodePath to which the actual shot model is parented.

Finally, the head model is instanced from a template held by the Weapon instance that is creating the weaponsfire, in order that I not end up setting textures and (in some cases, perhaps, albeit probably not for these quad-based shot models) flattening with every shot - I simply do it once and instance the model for each shot.

At the moment I think that I have the billboard effect applied to the offset NodePath (although I’m afraid that I don’t have my code to hand to check).

I’m not sure whether I’ve tried using a standard axial billboard effect and simply applying a rotation to the NodePath, instead of attempting to set the billboard axis - I should try to remember that when I get back to the game - although I suspect that the billboard effect will simply override it.

Thank you for the mention of the Rope class - it looks interesting, and I might well keep it in mind. :slight_smile: