Any Pointers on Creating Lightning

I was thinking a neat effect would be for my Logic gates to have lightning between the two inputs and the block.



Can anyone point me to how i could create this effect.

I just want a wavy line between two points.

Or Something like the Arrow Class where you tell it the Origin and the Vector and Length.



Thanks,

Greg

I am also interested in this :P, I have to make effects for my game soon as well, but I have left it quite late :P. I have no idea if this is even feasibly possible, because I don’t have much experience with effects, but what about a particle emitter and have bitmaps of varying different shapes of lightning bolts and adding a blue glow to them. But someone else probably got better advice for you :P.

I wonder if it could just be a emitter that could have its vector set. Anyone have any Ideas?

A billboard node with a start and an endpoint… You can calculate the length and stuff of the plane with the given Vectors. And then an animated Texture maybe?

One idea upon quick thinking…



Take the line, split it in two by calculating its midpoint and displacing it by a random amount. Do the same with those two halves and so on.



Render it as a really bright color and then maybe bloom post-process for a nice glow. You could even recalculate the splits every few frames to have it jump around.

pspeed said:
One idea upon quick thinking...

Take the line, split it in two by calculating its midpoint and displacing it by a random amount. Do the same with those two halves and so on.

Render it as a really bright color and then maybe bloom post-process for a nice glow. You could even recalculate the splits every few frames to have it jump around.

I was going to write that as well. Best solution if you want it to be animated randomly. I suggest adding extra ends at random positions and have those connected to the main line on random locations, thus making the forked effect you often see when lightning strikes.

I think I am going to try the billboard approach first since it seems to be the least resource use.



My plan is to make 2 two by 2 quad and scale and rotate it between the two connection blocks. Origin , Destination



This will stretch the texture but that should be ok.



The only thing I cant find is how to cycle through different textures on a quad.



Is there an example of how to cycle through different sections of a texture.



Use Case

I have a single image with 3 parts of a lightning strike. (Like a particle texture)

I want it to cycle over and over row 1,2,3 on the billboard quad.



Thanks for the help.

-Greg

Forget what I said about the billboard it doesn’t look right since its only in 2D.



I will try the geometry approach.

a particle emitter would be the easiest approach if i were to create lightning, create a custom texture, one long lightning, and have that set as a static particle (meaning no, variation in sizes etc) and then add another particle emitter to that node which creates like sparks around it, to give it some animation.

Yeah I would tend to follow the way of ryuu.

look at this blender tutorial http://www.blenderguru.com/how-to-create-a-lightning-storm/

I would render several images then use them on a particle emitter