SFML community forums

Help => Graphics => Topic started by: DarkNemesis on September 09, 2013, 02:49:14 pm

Title: Lightening Effect
Post by: DarkNemesis on September 09, 2013, 02:49:14 pm
Hello Guys..
I was just trying to create a random lightening effect similar to the one used in chicken invaders, if anyone has played the game.
But I really have no clue on how to produce an effect like that.
Do we have to use shaders for such an effect? Or do we need to use advanced Opengl (although I think this is a 2-D effect at most, SFML will be able to produce such an effect). Initially I thought about using Vertex points and implement randomness in them, but it got a bit complex.
So if anyone could help me regarding this, especially if he himself had tried and done this before, I  would be really happy and grateful.

P.S. If possible, check this video : https://www.youtube.com/watch?v=DhkuQfR_Bl0
I want the lightening effect to be a bit like the laser which the jet at the bottom is firing.
Title: Re: Lightening Effect
Post by: Sqasher on September 09, 2013, 05:53:22 pm
A google search for "algorithm for lightning" turned up this:

http://drilian.com/2009/02/25/lightning-bolts/ (http://drilian.com/2009/02/25/lightning-bolts/)

That should give you an idea how to begin.
Title: AW: Lightening Effect
Post by: eXpl0it3r on September 09, 2013, 08:16:36 pm
Seems like someone was faster in posting that link. ;)

I've also once created a simple lightning effect: GitHub (https://github.com/eXpl0it3r/Examples/tree/master/SFML/Lightning)