Making spell effects

Started by
11 comments, last by Raduprv 18 years, 9 months ago
Quote:Original post by Raduprv
I was wondering, for lightning, would alpha blended textured cylinders work?


Not really, it would be hard to make the edges "fade out", not to mention texturing the cylinder so the lightning looks like lightning.

For these kind of effects(and others, like spotlights,energy beams...), axial billboarding is great. You have a long quad that can rotate only in one axis so that it always face the camera. In my game, I use that and draw some coronas of different appearance along the length of the lightning:

Image Hosted by ImageShack.us

Advertisement
I've coded simple beam systems in the past. The basic idea is that you take a line and subdivide it, and then displace each of the vertices on the subdivided line in some direction perpendicular to the direction of the beam. Then you render the resulting polyline as either a line primitive or using screen-aligned quads. You can create a large variety of effects by varying the way in which the line is subdivided (evenly/randomly, number of points, etc) and the way in which points are displaced ("noisyness" of the beam).

You can take it a step further by allowing the attachment of things to points/vertices on the beam - such as, for example, the endpoint of another beam [grin] Can make some nice forking lightening that way, one fat beam in the middle with smaller, thinner beams coming off it halfway down and even smaller ones coming off of those...

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Mikeman, would you care to implement such spell effects in EL? Besides for Wytter, you are the only good OpenGL programmer.

superpig@ How do you generate the texture though? Is it procedural or prerendered?

This topic is closed to new replies.

Advertisement