Game Development Community

Torque 3D Development - Advanced Lighting

by Brett Seyler · 03/03/2009 (4:59 pm) · 44 comments

68.233.5.139/~transfer/brett/header_blog_t3d_dev-1.png

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 :)

68.233.5.139/~transfer/brett/pat-rounded-bordered.png

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...

68.233.5.139/~transfer/brett/tom-rounded-bordered.png

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."






68.233.5.139/~transfer/brett/brian-rounded-bordered.png

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:




About the author

Since 2007, I've done my best to steer Torque's development and brand toward the best opportunities in games middleware.

#21
03/04/2009 (12:40 am)
well i think in one of there other T3D blogs it said not everything is going to have a complete overhaul in the first round or something close to what i said. i know why most of the stuff is being remade its because its out of date t3d is going to be a up to date engine at lest seems that way. look at this they said its the best lighting systems in the industry might not be the best but its still good. maybe its the best because of performance i don't know. :P

i just cant wait to get T3D it just looks to dang good all these posts are just makeing me want it even more. its makeing me want to say give me it now as i cant wait for it anymore.
#22
03/04/2009 (1:05 am)
Quote:Beats by MOGWAI
As in the band? Kinda reminds me of Pelican, I'll have to check them out.
#23
03/04/2009 (1:55 am)
Quote:
Tom's Bio

"I'm currently working on a nearly complete rewrite of TerrainBlock"

This is sexiness!

Quote:
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.)

The link doesn't work. It asks me to log in with a @GarageGames.com account at Google :)
#24
03/04/2009 (4:04 am)
mmm ... that's some good WIP meat. ;D (@Mperry)

#25
03/04/2009 (4:21 am)
Looking pretty good guys. Its things like this that make T3D worth it. I am just crossing my fingers for a rock-solid physics rehaul!
#26
03/04/2009 (5:15 am)
@Stefan

Quote: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.)

Ya, link won't work for me either unless I have a account@garagegames.com I don't know about :p
#27
03/04/2009 (5:55 am)
Quote:Long-story short, we ended up with a unique hybrid approach called "Light Pre-Pass Rendering."

should definitely be able to screen that with the SSAO to produce physically accurate ambient lighting with almost no extra overhead.

Hmm as for the player hovering. I thought that was most likely it but it was impossible to tell as I was limited to a single angle of view. Great job on the lighting BTW.

I notice the the detached player a lot on older stuff as the terrain varies away from being horizontal. If I'm not mistaken isn't there support in DTS to have the player front and rear of their feet offset for this. At least there used to be. although almost no one ever used it. I think even Tribes 2 suffered from this. wich I have always though was odd if there was support for correcting it that none of the content creators never seem to use.
#28
03/04/2009 (6:38 am)
Hope trees and grasses will have better shadows in T3D. In TGEA, when the dynamic shadow is turned on, trees' leaves shadow appears as black squares, which looks not good.

@Tom,
It seems like Torque Forest pack will not be ready in the near future. Hope you're not in a hurry with it. But when you come out with it, hope you'll solve that dynamic shadow problem.


#29
03/04/2009 (8:26 am)
Looks good, the lighting is definitely showing some promise and although it's not totally finished (it's still a little pixelly it just needs blurring) it's looking great. I totally plan on taking advantage of this technology :D . Now all we need is this coded into T3D and it'll be great. :)
#30
03/04/2009 (10:53 am)
@game4Rest - Tree shadows and any alpha test materials work great...

farm4.static.flickr.com/3657/3326284664_89fed9c69f.jpg
#31
03/04/2009 (3:11 pm)
That is probably the second most awesome thing I've seen in T3D. Great work guys.
#32
03/04/2009 (4:14 pm)
@Tom
That's awesome. I know you've been asked so many times this question, but could you let us know when it will be available?
#33
03/04/2009 (4:16 pm)
Quote:Other projects I'm currently on include kicking the tires on our componentization refactor of Torque (not in Torque 3D)

Oh, but this is a must-have!! Is there any work like this going on for T3D?
#34
03/04/2009 (4:54 pm)
@Adib: Componentization is something that's been in the works for more than a year now. We've made significant progress, but we're not planning to roll those changes, which are enormous, into this next release. The next major release after that will likely be built on the componentization refactor, but we're very likely talking more than a year out for that. We're only just now beginning to develop games with that technology internally, so it's very raw still.
#35
03/05/2009 (4:08 pm)
nice work guys, it looks really good.
any thoughts on how to get a soft edge on 'long' shadows ?
ie as a shadow 'strikes' a surface more shallowly,
the shadow edges should tend to smear out a bit due to penumbration & diffraction.
#36
03/07/2009 (8:57 am)
I am guessing this isn't just for sun, right?

Could you mount something like a flashlight for that?
#37
03/07/2009 (10:34 am)
@Tyler - Yes... shadowed point lights and spot lights are also fully dynamic.
#38
03/07/2009 (6:23 pm)
You know, the unfortunate part of this is that I've received my taxes and I can't preorder this engine. Bummer dude!
#39
03/10/2009 (1:35 am)
Looks great but how many times scene is rendered?
#40
03/10/2009 (2:06 am)
@Krzysztof - Depends on your light/shadow setup and how you define the scene being rendered. In general...

1 render for zfill, eye depth, and eye normals.
2 or 3 renders for sun shadows which update every frame.
1 to 6 renders for each directional/point/spot light that is shadowed.
1 render for the normal diffuse render pass.

Keep in mind that the shadow passes usually render much less geometry than what you see in the scene as lights other than the sun have limited range. Also consider that you don't have to update shadows every frame in most cases.

Finally you have to remember reflections... they render the scene too. We've found that in reflections you can usually aggressively removed objects, skip shadows, and lights that are not the sun. We're trying to keep things flexible as possible with reflections, so that you can sacrifice some accuracy and quality for performance.

So... to get back to your question Krzysztof... it depends on the needs of your game how many times the scene is rendered. We only really require 2 renders of the scene... the rest is based on how many shadows and reflections you have.