PDA

View Full Version : Thunder effect How to begin ??



memmaker650
12-08-2012, 11:36 AM
I'm learning OpenGL programming with C/C++.

I want to create a 2D Thunder effect but i don't know how to start or a sample code that teach me how to modify it and customize it.

Thanks in advance.

cireneikual
12-08-2012, 04:27 PM
Here is how I would do it: Take a starting point, and then randomly branch out from there to some random number of branches or distance, drawing lines (made out of quads) as you go. You can bias the expansion towards a point. To do this, create a 2D vector with random x and y coordinates, normalize it, and add the bias vector. If you render it to a FBO, you can also blur it to make it look brighter (bloom): http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/.

memmaker650
12-09-2012, 07:21 AM
I will try your ideas and the concepts i see in the link.