well i'm just wondering on the best way to go about create some form of "Lightning" effect to be used in a game, so for example:

-In my game, i would like to have this effect in the menus and in-game in some form of random weather system perhaps.

Just wondering on the methods available? I did read this blog post: http://drilian.com/2009/02/25/lightning-bolts/

And took a-look at the Lightning sample thats around. I like the method placed in the blog post, just really a bit unsure on how to create the vertices from the lightning segments. I would be great if someone could explain that seconded sub-heading (Adding glow) a bit more to me :).

But like i said, i'm really want to know if there's any other ways i could accomplish this?


1 Answer 1


Creating quads: http://msdn.microsoft.com/en-us/library/bb464051(v=xnagamestudio.10).aspx. You need only one quad per segment, as in image 9 "lightning vertices" of the linked article you mentioned.

Next, the glow is first created by having a bitmap, a simple circle will do nicely, which blends from hard bright center to soft darker outside, and alpha similarly solid in center and disappearing to edges. Black background works too, depending on shader. A shader with some blend effect smooths things out.

It really is the most impressive lightning effect, doing it with hand-drawn sprites only works if you have a scene for that specific situation.

  • \$\begingroup\$ Thanks for the answer, exactly what i was looking for :). And yes, i agree, i could easily get my friend to draw a lightning animation of some sorts, but yes, in certain cases it wouldn't look right, and i feel it would really limit the effect (by having the same animation play). But yeah, thanks for the answer :) \$\endgroup\$
    – dan369
    Commented Jan 28, 2012 at 20:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .