Archived

This topic is now archived and is closed to further replies.

DJ_GL

Creating a Lightening Effect

Recommended Posts

Ysaneya    1383
Sounds like a perfect match for the Apocalypse contest

I''d create the lightning geometry by creating a tree. Start with a point in the sky and the down direction. Get a small random length and a probability; add a "ray" with the given length and the current direction; generate a random number, if it''s higher than the probability, split the ray in 2 ( with new random directions ) and recurse til you hit the ground.

As for rendering it, i''d use a triangle strip with a fading texture ( probably blue to white, with alpha-blending on ).

Y.

Share this post


Link to post
Share on other sites
DJ_GL    134
Thx for those great ideas! One more question, if I want a flash, where the whole screen goes WHITE and fades to the normal colors how should I go about this.

Share this post


Link to post
Share on other sites
ATronic    122
Just put a big quad with alpha in front of ur screen.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
DJ_GL    134
Thanks guys! Hmm... should I set the 3D view to Ortho view and than back to Perspective View when I use the quad that''ll be the flash?

Share this post


Link to post
Share on other sites
Lord Karnus    122
No need to change modes, that''ll just kill some fps....
Just draw the quad right in front of the screen, with all z
values equal to (or a little higher than) your near z-buffer range. Make sure the quad is big enough to cover the screen, and you should be good

email

Something kinda sad about
the way that things have come to be.
Desensitized to everything.
What became of subtlety?
--Tool

Share this post


Link to post
Share on other sites
Dactylos    122
You could also disable updates and testing of the z-buffer, when rendering the quad (it should cover everything anyway). This should provide a (small) performance boost.

Share this post


Link to post
Share on other sites