Valhalla Legends Forums Archive | Testing Forum | VB6 CGI Lightning (1.5mb+ of images)

AuthorMessageTime
Ringo
I saw a photo of a lightning bolt streeking acoss the nights sky and thought it looked cool!
So I thought what the hell, I would try to make some lightning bolts in vb6, useing nothing more than afew buffer's and make the math up as I go alone, on each pixel. Since I suck at math, it prooved pretty hard to pull off :(

Here's some images/animations/video files, showing where I started at, LoL bugs, and where i'm at now.
Tell me what ones you like best, what you think needs changing, etc etc.


Ok so I started with a "waypoint" consept, since any other way of doing it I was thinking up, involved added almost all known laws of phyisics to the project :P
Figured, might as well keep it simple.
[img]http://d2bot.cjb.net/images/vb6lightning/hm.png[/img]

Then I tryed adding *splits*, so a lightning bolt would split into multiple smaller bolts. This went tits up 1st attemp and split into a few to many.
[img]http://d2bot.cjb.net/images/vb6lightning/ha.gif[/img]

Then I tryed to fix it, and it literly went super nova/blew up in my face :o
[img]http://d2bot.cjb.net/images/vb6lightning/Image1.png[/img]

After I got that working abit better, I set up a block of floating point variables to be the "image data", so I could do small calculations on each R, G, B and A values, then round them off to a RGBA byte based buffer after each update, to be dumped to file along with a bitmap file/info header.
For 1st attempt at the graphic, I was pretty impressed, altho it was abit square shape.
[img]http://d2bot.cjb.net/images/vb6lightning/vbLightning.png[/img]

So, I tryed to make the image abit better, by adding some back ground lighting effect, as the sky would light up as nitrogen reflects the white light, as blue light.
This had a halow effect, close to the bolt :(
[img]http://d2bot.cjb.net/images/vb6lightning/umm.png[/img] MultiStrike.avi.zip 1 second video clip of this style, 1 frame per 5 updates, 50fps.

So I expanded on this halow effect to see if it would work as background lighting
[img]http://d2bot.cjb.net/images/vb6lightning/00000015.png[/img]

Then I spent most of aday rewriteing it, trying all kinds of things, to stop multiple bolts *white* burning each other, and background lighting effects refuseing to blend with out a small noticeable seam.
I could get 1 or the other, but not both :/
So, I just started fucking around with it today, and reverted back, with some minor tweeks here and there;
[img]http://d2bot.cjb.net/images/vb6lightning/Letter_T.gif[/img][img]http://d2bot.cjb.net/images/vb6lightning/Letter_E.gif[/img][img]http://d2bot.cjb.net/images/vb6lightning/Letter_S.gif[/img][img]http://d2bot.cjb.net/images/vb6lightning/Letter_T.gif[/img]

[img]http://d2bot.cjb.net/images/vb6lightning/Animation1.gif[/img]

[img]http://d2bot.cjb.net/images/vb6lightning/Animation2.gif[/img]

[img]http://d2bot.cjb.net/images/vb6lightning/Lightning.png[/img][img]http://d2bot.cjb.net/images/vb6lightning/boltani.gif[/img]

And heres a high_def_annimation.mng of one, just this morning. Its 1 frame every 5 updates.


Persionaly, I like this one the best and the still image just above this.
(The only above has better background lighting/shadeing imo)
[img]http://d2bot.cjb.net/images/vb6lightning/00000015.png[/img]
What about you?
May 15, 2009, 9:34 AM
Myndfyr
Interesting idea.  I like your first "real" rendering the best personally.
May 15, 2009, 4:16 PM
Spht
Nice.  this is what lightning really looks like in slow motion
May 15, 2009, 5:17 PM
Ringo
[quote author=MyndFyre link=topic=17954.msg182750#msg182750 date=1242404171]
I like your first "real" rendering the best personally.
[/quote]
Cool. You're the 2nd persion to favor that one for some reason :p
I'm guessing it must be the shape? Because I thought persionaly the shadeing was to pixely/squarey (that was before I added rounded shadeing)


[quote author=Spht link=topic=17954.msg182751#msg182751 date=1242407827]
Nice.  this is what lightning really looks like in slow motion
[/quote]
heh, Funny you should link to that vid, I orginaly watched the 1st half of it for about 20mins solid, before starting this :)
I decided the phyisics would be to much hastle, and hard to minipulate :P
I would need to make some kind of "web" structure, then as soon as 1 bolt hits the "earth", all the energy down all the bolts, get drawn back through the quickest route in the web, to that point.

I did abit more tinkering this morning (looks unreallistic, but it was just for fun :P)
I've added a soften-type function, that runs on the renderd bitmap data, to try blend the pixels better;

I removed background shadeing in this one, by drasticly lowering the radius of lighting around the bolt, and forgot what other variables I adjusted (ive got about 30 constants that define how it acts)
[img]http://d2bot.cjb.net/images/vb6lightning/1.png[/img]

These 2 are pretty much were I left it yesterday, give or take a few adjustments.
Good example of what I mean by "white burning" :(
[img]http://d2bot.cjb.net/images/vb6lightning/image2.png[/img]
[img]http://d2bot.cjb.net/images/vb6lightning/image3.png[/img]

So I tryed somthing I tryed the other day, where the back light gets computerd onto a 2nd buffer/layer, then both layers get bind together (brightest color wins, etc) and changed a bunch of other things;
[img]http://d2bot.cjb.net/images/vb6lightning/image4.png[/img]
Only the 1st and 2nd generation bolts have background shadeing in this last image, hence the dark top corners. Also the radius of back lighting is fairly low, other wise it would have taken about 20mins to generate -- but mr white burn ur eyes out, is no more :) It also looks less "foggy" imo :o
May 16, 2009, 5:35 PM

Search