Torque 3D Development - Depth of Field
by Brett Seyler · 02/22/2009 (11:11 pm) · 38 comments
Last week, we announced a major update to the Torque art pipeline: native Collada file loading. Today we're circling back to Gerhard Botha's work again to preview the Depth of Field shader (DoF) for Torque 3D.
The video below shows the full DoF functionality we expect to ship with Torque 3D. Each real-time variable parameter for the shader will be accessible in script, and perhaps in the editor interface as well. For this video though, commands were keybound as we're (still) not yet ready to show the new editor updates.
The lighting in this footage is also still far from complete. Gerhard is working with a hybrid of our new Torque 3D Advanced Lighting, and the older TGEA lighting. Pay attention to the notes in the video that precede the actual footage. The DoF shader has been exaggerated in a number of ways to better demonstrate the effect.
I've still yet to introduce you all to Ruan West, the man responsible for the art content in these videos we've used to show Gerhard's programming work. We'll talk to Ruan soon and hopefully learn something about how he creates such nice looking stuff in Torque. We'll also get his feedback on the new content pipeline for Torque 3D, and perhaps we'll have been able to reveal additional updates to Torque's content pipeline as well.
Gerhard still has a lot to show us too, of course. For a quick review in case you missed the Wetness & Precipitation blog where he was formally introduced, here's quick backgrounder on Gerhard and his work on Torque 3D.

Gerhard's Bio
"I am the head of software development in South Africa for an England based company developing software and hardware solutions for fatigue testing and structural analysis for the automotive and aerospace industries. My weekend hobby is the development of plugins for 3D Studio Max as well as the development of advanced gaming features and shaders for Torque. I am currently working on some AI and advanced shaders for Torque 3D which includes:
Screen Space shaders (Ambient Occlusion (SSAO), Bloom, Depth of field, Geometry smoothing. Motion blur)
GPU cloth dynamics.
GPU simulated water effects.
GPU soft particles.
GPU soft/rigid body dynamics.
Dynamically destructible objects.
Computational intelligence algorithms for AI usage.
Multi-pass deferred CustomMaterial shaders."More development blogs to come. This is post #11.
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.
#3
02/23/2009 (5:28 am)
Nice feature addition to T3D. Glad I didn't add yet to TGEA since its now in T3D..:)
#4
02/23/2009 (6:30 am)
Looking really great guys - love seeing some of the flashy new functionality being added to Torque 3D, are you all really pleased with how it's progressing?
#5
02/23/2009 (7:24 am)
Awesome! 'Nuff said.
#6
02/23/2009 (8:40 am)
Gerhard should make an engine of his own.
#8
02/23/2009 (10:06 am)
You might want to upgrade your adobe flash player (www.adobe.com)
#9
On a side note, don't forget to change "aperature" to "aperture" in the text of the demo.
02/23/2009 (10:15 am)
Nice demo! Pretty pretty pretty!On a side note, don't forget to change "aperature" to "aperture" in the text of the demo.
#10
02/23/2009 (10:17 am)
Love this video can't wait to see more.
#11
02/23/2009 (10:37 am)
Fantastic work, Gerhard.
#12
In real life, I turn my head to a position and then can move my eyes to look anywhere in my field of view. The things I look at are clear.
In a game there might be a sign some distance off, but within my field of view. I shouldn't have to turn my head to make it less blurry. I'd look over there with my eyes and it would be focused.
It's the only beef I have with DoF in games. Why should I have to turn my head to get a clearer picture?
(Much like lens flare, these should be used as camera/cinema effects, not people effects.)
02/23/2009 (11:03 am)
Just a note to future designers...In real life, I turn my head to a position and then can move my eyes to look anywhere in my field of view. The things I look at are clear.
In a game there might be a sign some distance off, but within my field of view. I shouldn't have to turn my head to make it less blurry. I'd look over there with my eyes and it would be focused.
It's the only beef I have with DoF in games. Why should I have to turn my head to get a clearer picture?
(Much like lens flare, these should be used as camera/cinema effects, not people effects.)
#13
02/23/2009 (11:11 am)
I do have the latest Flash player. No video... (Mac OS 10.5.6, Safari or Firefox)
#14
02/23/2009 (11:26 am)
Note on the video: I was having some problems with this too initially, and refreshing the blog helped. Since then, I haven't had a problem. As far as I can tell, it's a Vimeo snag, but we're looking into it to triple check it isn't a problem on our end.
#15
Not really true, just appears to be in focus. Humans have a 180 deg field of view with only about 140 deg of that usable for depth perception. This leaves about 40 deg that is not in clear focus.
If you want to program the camera to turn your eyes you can, then program another command for turning the head. But that's not practicle, so in games you generally just turn the camera and head. Just easier.
I like the idea of FOV. Because as a firearms instructor, this is very evident. If you don't believe me hold your finger at arms length in front of you and focus on your finger with your monitor behind it (or something to read). Then try and read the monitor behind it.. It's not in focus.... Your eyes are only focused on what you are looking at. You can see the text, but not to the detail of reading it. As noted in the video above, it's exaggerated for effect. Although I would use this, I would not to the level used in the demo. It should just be slight.
Now, if you are like me and have progressive lens glasses, you know very well about depth of field:).
02/23/2009 (11:39 am)
@WilliamNot really true, just appears to be in focus. Humans have a 180 deg field of view with only about 140 deg of that usable for depth perception. This leaves about 40 deg that is not in clear focus.
If you want to program the camera to turn your eyes you can, then program another command for turning the head. But that's not practicle, so in games you generally just turn the camera and head. Just easier.
I like the idea of FOV. Because as a firearms instructor, this is very evident. If you don't believe me hold your finger at arms length in front of you and focus on your finger with your monitor behind it (or something to read). Then try and read the monitor behind it.. It's not in focus.... Your eyes are only focused on what you are looking at. You can see the text, but not to the detail of reading it. As noted in the video above, it's exaggerated for effect. Although I would use this, I would not to the level used in the demo. It should just be slight.
Now, if you are like me and have progressive lens glasses, you know very well about depth of field:).
#16
02/23/2009 (12:13 pm)
@Deborah: I've tried refreshing and using different browsers, still just a big blank space...
#17
02/23/2009 (12:21 pm)
What technique is used for blur? It's hard to see in the video. Multisampling or something more complicated?
#18
My point is that you DO have about 140 degrees that you can look around in without turning your head.
In a game without DoF, I can look around the screen as though my eyes were looking around. I am able to "focus" on that spot (say, a player in the distance) because there is no blurring.
In a game with DoF, I have to turn my head _exactly_ toward the player to de-blur the distance, something I don't have to do in real life.
02/23/2009 (1:13 pm)
@RandyMy point is that you DO have about 140 degrees that you can look around in without turning your head.
In a game without DoF, I can look around the screen as though my eyes were looking around. I am able to "focus" on that spot (say, a player in the distance) because there is no blurring.
In a game with DoF, I have to turn my head _exactly_ toward the player to de-blur the distance, something I don't have to do in real life.
#19
It reminds me of the Depth of Field pack that you can buy from Ubiq Visuals Store (www.garagegames.com/community/blogs/view/16229 for TGEA).
02/23/2009 (1:14 pm)
That's awesome stuff for sure. It reminds me of the Depth of Field pack that you can buy from Ubiq Visuals Store (www.garagegames.com/community/blogs/view/16229 for TGEA).
#20
Sure the hell beats a set distance DOF, used just for effect.
02/23/2009 (1:17 pm)
The auto focus would be exceptionally nice used subtly for first person.Sure the hell beats a set distance DOF, used just for effect.
Torque 3D Owner Daniel Buckmaster