lightning?

Blitz3D Forums/Blitz3D Programming/lightning?

jhocking(Posted 2006) [#1]
Anyone know how to do a lightning bolt effect? Distant lightning is easy (use a picture of lightning for a sprite on the horizon) but how do I do something close up, like a lightning gun or something?


scribbla(Posted 2006) [#2]
if you see Ross C ask him

he has come up with a lightning gun that looks very very cool


Ross C(Posted 2006) [#3]
Hey Joe. I've uploaded some of the stuff. I wanted to make each lightning strike a single surface, but i ended up with each branch being a deformed cylinder. I create a rod, then deform it, each deform point being a possible location for a branch of lightning to come out (another deformed cylinder). Run lightning_newest, to see it in action. ARROW keys plus the mouse left and right buttons to move.


Ross C(Posted 2006) [#4]
And the link :S

www.rosscrooks.pwp.blueyonder.co.uk/lightning.zip


Stevie G(Posted 2006) [#5]
Very Nice!


John Blackledge(Posted 2006) [#6]
That is THE best lightning I've seen in Blitz.


jhocking(Posted 2006) [#7]
Cool, thanks. I'll take a look when I get home.


MadJack(Posted 2006) [#8]
Good stuff. Public domain?


puki(Posted 2006) [#9]
From memory, that landscape one looks very similar to a demo that came with B3D - the one I remember didn't have the isolated cloud flashes though.


Ross C(Posted 2006) [#10]
Yep, sure, use it however you want :o) As for the landscape, i just grabbed a couple of textures and stuck 'em on a plane :o)


puki(Posted 2006) [#11]
Yes, I have checked my records. "Ross C's" example is similar in appearance to 'Lightning Effect' by "David Bird" in the "birdie" directory of the B3D 3D samples directory.

"Ross C's" lightning bolts are better.


Ross C(Posted 2006) [#12]
Maybe i nicked the texture from there ^_^ Sorry birdie if i did :o)


DroolBucket(Posted 2006) [#13]
This is amazing, but i think you could do better. I really enjoyed the fact that not all bolts are drawn to the ground and appear as bursts of light, just great!


SLotman(Posted 2007) [#14]
I know this is an old thread, but does anyone still have that lightning code? I would love to see that, but the link is 404 :(


Ross C(Posted 2007) [#15]
Hmm, you'll need to wait till i get home :o) I think i cleared some stuff off my webspace.


Yeshu777(Posted 2007) [#16]
Missed this so would like to see it


boomboom(Posted 2007) [#17]
We could really do with a resource section where people can upload too so its kept....


Ross C(Posted 2007) [#18]
Ok, here:

http://www.rosscrooks.pwp.blueyonder.co.uk/lightning.zip

It was part of a project that fell by the wayside. Hopefully i can link up one day and get it finished!

I will post further comments on how to use it.


SLotman(Posted 2007) [#19]
Thank you so much! Going to check it out right now :)


Ben(t)(Posted 2007) [#20]
flippin schweet man


sethus(Posted 2010) [#21]
The thread is 2 years old again, could someone please reup? :D


Ross C(Posted 2010) [#22]
I'll need to try and find where I keep it :D I'm sure I made a single surface version that was alot faster. Gimme a bit to find this.


Leon Drake(Posted 2010) [#23]
i usually make a few layers of the same surface scaled up and overlapped with entityblend set to alpha.. it really enhances the effect.


Ross C(Posted 2010) [#24]
Ok, i've had a right good dig, but i can't find it. I can tell you exactly how it worked though.

I created a create cylinder function, with an adjustable segment amount. For lightning, i created a 3 sided cylinder, with lots of segments. Then ran this through a random turn at each segment, with a small random possiblity each turn could generate another lightning bolt. I set my vertex texture co-ords properly, so i could map a small gradient texture onto it. giving you a lightning type look.

Each lightning strike was created dynamically too. IF i have time, i will rewrite this :)


Knight #51(Posted 2010) [#25]
Please do :D Sounds neat!