by date
Lightning Anyone?
Lightning Anyone?
| Name: | Josh Moore | ![]() |
|---|---|---|
| Date Posted: | Oct 08, 2006 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Josh Moore |
Blog post
After a long time of off-and-on development, I finaly have a functional, decent looking(IMHO) lightning effect for the Torque Shader Engine bounty packaged and submitted! It's taken about 5 major code reversions to get the current system. I experimented with more than a few object setups and rendering methods untill I came up with something solid enough for a general solution.

Currently the lightning is lacking some important features(such as SM 1.x support), but I think it's ready to be used. I've uploaded an initial version that can be dropped right into a TSE HEAD build. The download can be found on the TSE Lightning Bounty page. I'm waiting on some feedback from GarageGames and from the community before starting the next level of development.
More screenshots:
static.flickr.com/88/260032609_2a5a2e1b5a_o.png
static.flickr.com/91/260032608_aab82b507e_o.png
static.flickr.com/91/260032607_236ad5c3d8_o.png
From the lightning.h source file:
Lightning strikes are rendered via static vertex buffers(one buffer for each strike) that are built and filled when a strike is created. All information the strike needs is stored in the vertex buffer and is used by a custom shader. This includes: bolt size/width, power(or intensity), and life cycle times. Indexing is not used as it poses complications, so drawPrimitive is called for every lightning bolt/split tri-strip segment. Using triangle lists might produce better performance, but I haven't tested that yet.
I ask any TSE owners to go check out the code and post your comments here, on the bounty page, or in the forums.

Currently the lightning is lacking some important features(such as SM 1.x support), but I think it's ready to be used. I've uploaded an initial version that can be dropped right into a TSE HEAD build. The download can be found on the TSE Lightning Bounty page. I'm waiting on some feedback from GarageGames and from the community before starting the next level of development.
More screenshots:
static.flickr.com/88/260032609_2a5a2e1b5a_o.png
static.flickr.com/91/260032608_aab82b507e_o.png
static.flickr.com/91/260032607_236ad5c3d8_o.png
From the lightning.h source file:
Quote:
The new lightning system uses a 2 datablock setup; one to define
a certain type of lightning strike, the other to define an actual
lightning object (or storm). I chose to go with this route as it
allows for mixing and matching of strikes and sounds (and other data)
inbetween different lightning object datablocks. It also allows for
for more control over a specific type of strike, and supports upto
eight different lightning strike types in a single object/storm instance.
Lightning objects themselves are SceneObjects that can now be placed
and moved anywhere in the map. The lightning strikes inside of the
object's scaled bounding box, so it can be confined to certain sections
of terrain, or even inside interiors. If need be, an option to use the
mission area as the strike zone could be added.
Lightning strikes are rendered via static vertex buffers(one buffer for each strike) that are built and filled when a strike is created. All information the strike needs is stored in the vertex buffer and is used by a custom shader. This includes: bolt size/width, power(or intensity), and life cycle times. Indexing is not used as it poses complications, so drawPrimitive is called for every lightning bolt/split tri-strip segment. Using triangle lists might produce better performance, but I haven't tested that yet.
I ask any TSE owners to go check out the code and post your comments here, on the bounty page, or in the forums.
Recent Blog Posts
| List: | 08/23/07 - What's up & T2d 10/08/06 - Lightning Anyone? 09/19/06 - Quick .plan - TSE works... 02/19/06 - Illumina: Development continues... 12/05/05 - Plan for Josh Moore 09/19/05 - Plan for Josh Moore 08/30/05 - Plan for Josh Moore 04/28/05 - Plan for Josh "The_Force" Moore |
|---|
Submit your own resources!| Plague (Oct 08, 2006 at 05:20 GMT) |
| Ajari Wilson (Oct 08, 2006 at 07:01 GMT) |
| Jeremy Alessi (Oct 08, 2006 at 07:23 GMT) |
| Maxwell Marsh (Oct 08, 2006 at 08:25 GMT) |
It would look even better if it lit the sky up when it struck.
| Matt Fairfax (Oct 08, 2006 at 09:08 GMT) |
| Ben -Djaggernaut- Chavigner (Oct 08, 2006 at 09:19 GMT) Resource Rating: 5 |
| Tom Bentz (Oct 08, 2006 at 09:53 GMT) |
| Mincetro (Oct 08, 2006 at 11:59 GMT) |
Thankyou very much for sharing this!
| James Thompson (Oct 08, 2006 at 12:30 GMT) |
| Teck Lee Tan (Oct 08, 2006 at 12:39 GMT) |
| Vashner (Oct 08, 2006 at 15:54 GMT) Resource Rating: 5 |
| Daniel Allessi (Oct 08, 2006 at 16:19 GMT) |
| Juha Eerola (Oct 08, 2006 at 16:26 GMT) |
| Dave Young (Oct 08, 2006 at 17:40 GMT) |
| Don Hogan (Oct 09, 2006 at 01:23 GMT) |
| Josh Moore (Oct 12, 2006 at 20:35 GMT) |
| Sorin Daraban (Mar 28, 2007 at 01:51 GMT) |
My e-mail is sorind1@hotmail.com
I tried getting the code from the link above, but I can't get in.
I've tried to register several times, but to no avail.
I still haven't received a password to login.
Thanks in advance.
| Sorin Daraban (Mar 28, 2007 at 02:02 GMT) |
I finally got in and downloaded it.
Thanks, though.
| Chris \"C2\" Byars (Jul 19, 2007 at 14:19 GMT) |
| KEVIN LANGHOFF (Sep 30, 2007 at 07:28 GMT) |
| Kory James (Nov 02, 2007 at 18:08 GMT) |
| JoZ (Nov 02, 2007 at 19:49 GMT) |
Kevin, Kory, sent an e-mail to you with the resource...
Have a nice time ;)
| Wigon (Dec 03, 2007 at 16:05 GMT) |
My e-mail is wigon@o2.pl
Thanks
| JoZ (Dec 04, 2007 at 14:48 GMT) |
Enjoy it ;)
| David J Weaver (Dec 23, 2007 at 05:42 GMT) Resource Rating: 5 |
Can you send the code to Trojke3@yahoo.com ?
Please?
| JoZ (Jan 03, 2008 at 16:12 GMT) |
It seems me too I cannot find anymore the links in this page... Fortunately I still having it in my "sent message" folder in thunderbird... :-P
Enjoy it!
| David J Weaver (Jan 04, 2008 at 01:38 GMT) Resource Rating: 5 |
| JoZ (Jan 29, 2008 at 16:52 GMT) |
Anyway if someone want to host the file would be pretty for all the community...
;D
| JoZ (Jan 29, 2008 at 16:59 GMT) |
... sorry I see your post only 1 minute ago... it seem your problem is you hadn't added this in your client/script/shaders.cs
//-----------------------------------------------------------------------------
// LightningShaderData (see http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11390)
//-----------------------------------------------------------------------------
new ShaderData( LightningShaderData )
{
DXVertexShaderFile = "shaders/lightningV.hlsl";
DXPixelShaderFile = "shaders/lightningP.hlsl";
pixVersion = 2.0;
};
remember to always implement there your shaders' datablocks when you're adding shaders.
;)
| David Jauregui (Feb 17, 2008 at 07:47 GMT) |
| JoZ (Feb 19, 2008 at 13:00 GMT) |
| Harvey Greensall (Mar 02, 2008 at 13:59 GMT) |
| JoZ (Mar 02, 2008 at 21:24 GMT) |
It's not so a big problem sending a mail to someone so don't worry...
Anyway if there is someone out there that wanna host the file would be usefull to everyone will need it instead to wait for having me reading their e-mails :-)
So if someone wanna host it he only need to let me know posting there :-)
JoZ
| Harvey Greensall (Mar 05, 2008 at 12:21 GMT) |
If we can get it working, I'll have a chat with the guy that does our site and see if there's anywhere we can host the files if you like 8)
Cheers
H.
| John "Mythic" Henry (Jul 27, 2008 at 14:24 GMT) |
Thx.
You must be a member and be logged in to either append comments or rate this resource.



5.0 out of 5


