Torque 3D Development - Advanced Lighting
by Brett Seyler · 03/03/2009 (4:59 pm) · 44 comments
Time's getting short...so it's time to start rolling out some big guns. This week we're looking at a major update to Torque's lighting and rendering system. This all started with a man name Pat Wilson who, months ago, began working on a side project to implement a new partial deferred renderer for Torque. This is the kind of thing Pat does when he's bored :)

Pat's Bio
"Early last year I started experimenting with a new lighting model for Torque in my spare time. I started applying it to Rokkitball development post-launch and now with Brian and Tom, we're rolling out a unified advanted lighting / rendering / shadowing model for Torque 3D."
"I interned at GG back in 2003 and joined 2004. In the time since then I've worked on games, tech, and just about everything GG does. I worked on Marble Blast Ultra, Torque 360, Rokkitball, and pretty much every other Torque product out there."
Pat's work to replace Torque's existing lighting model started with some pretty high-level theoretical stuff, but it paid off. We now have a very flexible, performant lighting model for the future of Torque. Traditional lighting, like that currently in TGEA, comes in single-pass and multi-pass varieties. Multi-pass lighting has been used well in Torque before, but as a general concept, is scales poorly with objects and lights (n objects and m lights --> n * m object draws in some scenarios).
Deferred shading also has it's drawbacks (requires multiple render targets, doesn't perform well w/ multiple materials), so Pat was looking at hybrid models that would really serve our needs with Torque better than the simple low end compatibility of forward rendering (pass limited) or the commonly used next-gen deferred shading model (a hardware hog in many common use cases.)
Long-story short, we ended up with a unique hybrid approach called "Light Pre-Pass Rendering." He wrote a brief, if unfinished outline of journey to this model in this presentation here (warning...be prepared to math it up.)
So, remember this blog way back when (March 2008)? Well, Pat's experimentation, and eventual use of this lighting model is the perfect example of Studios experimentation with a branch of Torque that's probably not stable enough for widespread licensing, but if proven out (as Pat's lighting model was on Rokkitball and other projects) can be rolled into Torque for the public. That's where these guys come in...

Tom's Bio
"I'm currently working on a nearly complete rewrite of TerrainBlock, improving the art pipeline with live asset updates, putting the finishing touches on the Forest Kit, and various general improvements to the Torque codebase. Still by far the most exciting thing i'm doing is helping Pat Wilson and Brian Richardson integrate the new advanced lighting system into Torque 3D."
"I'm a programmer and co-owner of Sickhead Games, LLC a small indie game studio in Dallas, Texas. I guide our technological direction and deal with important business operations. Prior to founding Sickhead i was the Lead Programmer on the Core Technology Team at Motorsports Simulations, Inc, where i worked on the hit NHRA drag racing series."

Brian's Bio
"I spent the first part of 2008, and some more time in the past couple months working on the new shadowing system that is going to ship in Torque 3D. Other projects I'm currently on include kicking the tires on our componentization refactor of Torque (not in Torque 3D) in R&D by prototyping a kart racing game. I'm having a lot of fun with it because a kart racing game was the first little project I attempted with TGE years ago."
"I've been hacking since he was a little boy. I've shipped lots of different kinds of software so far and one of my projects won a Technical Emmy. I'm noping to to create more trippy things in the future. "
Quite a rogue's gallery of talent, no? HUGE thanks to these three for really stepping it up and putting the finishing touches on the new system. Between these three, there's a good chance that Torque 3D will have one of the best lighting systems in the industry, right on par with the lighting models in games like Fable 2. Here's a quick look at what we're doing right now inside of Torque 3D...
The shadows in Advanced Lighting are infinity customizeable. You can achieve just about any look and tune things to perfectly match your scene. Cool stuff huh? I realize lots of you out there are thirsty for a close look at new tools and UI. That's coming soon...getting very close now, so be patient :)
More development blogs to come. This is post #12.
Torque 3D development blogs:
- Post #1 - Kickoff
- Post #2 - Apparatus and Warrior Camp
- Post #3 - Luma's racing kit
- Post #4 - Josh Engebretson and Web Publishing
- Post #5 - Pricing and Licensing
- Post #6 - Pricing and Licensing CONTINUED
- Post #7 - Wetness & Precipitation
- Post #8 - Screeen Space Ambient Occlusion (SSAO)
- Post #9 - Matt Langley and the Torque Launcher
- Post #10 - Chris Robertson and Collada
- Post #11 - Depth of Field
- Post #12 - Advanced Lighting
- Post #13 - Soft Particles
- Post #14 - World Editor
- Post #15 - Pricing and Licensing ANNOUNCED!
- Post #16 - GDC Live Edition
- Post #17 - River & Road Editors
- Post #18 - Beta is UP!
- Post #19 - Light Rays, Undercity, Material Editor
- Post #20 - Mass Market Hardware
- Post #21 - Beta: Part Deux
- Post #22 - Marching Towards Beta 3
- Post #23 - pureLIGHT
- Post #24 - Lighting, Terrain, and Cloth
- Post #25 - Beta 3!
- Post #26 - Coming Soon!
About the author
Since 2007, I've done my best to steer Torque's development and brand toward the best opportunities in games middleware.
#2
03/03/2009 (5:35 pm)
Great job
#3
03/03/2009 (5:57 pm)
@Marcus: Probably @GDC, yes.
#5
03/03/2009 (6:05 pm)
just one more thing please keep in mind Spherical Harmonic Lighting (global illumination), Time of Day, and Real-Time Atmospheric Scattering. Keep up the fantastic work!!!
#6
the environment stuff but there is something weird going on with the characters shadow.
I second the thing about the SSAO but if you really want to archive something special and very "physically accurate" Make the SSAO have the ability to using the light information mask the SSAO effect. This gets rid of almost all of the short comings of SSAO. "That being that Ambient occlusion is not omnipresent. It only exist in areas that are not under direct light. Basically screen the raw lighting pass over the Ambient pass. I would not think it would take much more to do in the shader as both already exist.
for more information on what I'm talking about read this:
mentalraytips.blogspot.com/2008/11/joy-of-little-ambience.html
03/03/2009 (6:06 pm)
is the character floating or is the shadow offset from the geometry?the environment stuff but there is something weird going on with the characters shadow.
I second the thing about the SSAO but if you really want to archive something special and very "physically accurate" Make the SSAO have the ability to using the light information mask the SSAO effect. This gets rid of almost all of the short comings of SSAO. "That being that Ambient occlusion is not omnipresent. It only exist in areas that are not under direct light. Basically screen the raw lighting pass over the Ambient pass. I would not think it would take much more to do in the shader as both already exist.
for more information on what I'm talking about read this:
mentalraytips.blogspot.com/2008/11/joy-of-little-ambience.html
#7
I'm assuming you'll be able to mix this in with environmental lighting/shading, something somehow? So you can have sunrises turn to day, into sunsets with full on skybox changes, different hues on the horizon etc...
03/03/2009 (6:09 pm)
Looks incredible, you guys need to stop making me want T3D! What are the impact as compared to baked lighting, will there still be baked-in lighting?I'm assuming you'll be able to mix this in with environmental lighting/shading, something somehow? So you can have sunrises turn to day, into sunsets with full on skybox changes, different hues on the horizon etc...
#8
03/03/2009 (6:10 pm)
Question are there plans to make the sky itself change accordingly? it this now a sky shader or is it a skybox still?
#9
03/03/2009 (6:13 pm)
There is no correlation between Advanced lighting and the Sky Object, but it is possible to create day/night transitions painlessly now.
#10
03/03/2009 (6:18 pm)
Very cool stuff. I'm a big fan of deferred shading, but it's probably a bit too card hungry for most indie purposes, so a middle ground solution is a great idea for Torque. Kudos to Pat, Tom and Brian, looking good guys. Keep the goodness rolling in ;)
#11
03/03/2009 (7:23 pm)
Lots of cool! factor for the new lighting. The scene at the end looked really nice. Buildings, lampposts, even the fences... and all of the shadows were moving!
#12
i don't think i going to have real time in my first game but i can still add it in if i want the keeping the story line with the time of day might be a pain. i also seen you said "Time's getting short" so what your getting close to finishing everything you guys want done for the first release of t3d. if time is getting short have you guys made up your mind on pricing yet. :P
03/03/2009 (8:15 pm)
wow thats good work i know why the shadows kind of look messed up its because your moving that sun way to fast. i don't think anyone will move it that fast its the shadows that cant keep up with the computer. i would think it takes up a fairly large amount of memory to run shadows passes that fast or how ever you do it.i don't think i going to have real time in my first game but i can still add it in if i want the keeping the story line with the time of day might be a pain. i also seen you said "Time's getting short" so what your getting close to finishing everything you guys want done for the first release of t3d. if time is getting short have you guys made up your mind on pricing yet. :P
#13
03/03/2009 (8:16 pm)
*DROOOOLS, DROOOOOOOOLS even more. yeah baby bring it. :P - nough said :P
#14
03/03/2009 (9:02 pm)
Nice work, guys!
#15
That's exactly right. The shadow map is being hugely overstressed with the sun moving that fast across so many shadow-casting objects, but even so, it holds up admirably. We'll be continuing to work at achieving even higher shadow quality and better performance over the next couple months.
03/03/2009 (9:05 pm)
@Brandon: Quote:i know why the shadows kind of look messed up its because your moving that sun way to fast. i don't think anyone will move it that fast its the shadows that cant keep up with the computer.
That's exactly right. The shadow map is being hugely overstressed with the sun moving that fast across so many shadow-casting objects, but even so, it holds up admirably. We'll be continuing to work at achieving even higher shadow quality and better performance over the next couple months.
#16
see image:

03/03/2009 (9:26 pm)
No I mean either the guy is not contacting the ground or the shadow for the character is being offset.see image:

#17
03/03/2009 (9:30 pm)
@James Brad Barnette: Just when you think you can cap some footage with minor WIP warts... :) The player model is just not colliding with the mesh correctly. It's nothing to do with the lighting. Probably just poorly set collision on the player for that player model. Know what I mean? The lighting is doing exactly what it should be doing.
#18
edit: or just what Brett said. :P
03/03/2009 (9:31 pm)
i think thats because that is where that 3d object collision is. i might be wrong though as in the game i don't think its like that. i have not played it for over a month so i don't quite know. they can even make it in game to where you cant notice that as well as in the real game its just a rolling ball it looks the same all the way around the ball. that 3d object was never made to have a complex character on it. :Pedit: or just what Brett said. :P
#19
@James: Heh, like Brett just said, the player model is floating above the object for some reason. I had a heart stopping moment when I was playing with this level when I saw the shadow was not meeting the feet. But if you fly around with the free cam, you can see the player is floating above the ground. This is just due to how the player code orients the shape above curvy surfaces. You can see the same type of thing with hills. I *think* there's a resource floating (another bad pun!) around that will orient the player's z axis with the ground which would help this a bit.
03/03/2009 (10:12 pm)
woot! It's cool that this is seeing the light of day (ohh, bad pun!)@James: Heh, like Brett just said, the player model is floating above the object for some reason. I had a heart stopping moment when I was playing with this level when I saw the shadow was not meeting the feet. But if you fly around with the free cam, you can see the player is floating above the ground. This is just due to how the player code orients the shape above curvy surfaces. You can see the same type of thing with hills. I *think* there's a resource floating (another bad pun!) around that will orient the player's z axis with the ground which would help this a bit.
#20
03/04/2009 (12:23 am)
Superb work guys.... is there any part of Torque that's not getting a complete overhaul for Torque 3D!?!? 
Torque 3D Owner Dark Tengu