TGEA deferred rendering and PhysX
by Adrian W · 09/13/2009 (3:40 am) · 20 comments
Since the last blog, I've finished porting my deferred rendering code up to TGEA 1.8.1. There are still a few things to do before I can release the promised demo (should have 1.7.1 and 1.8.1 binaries for people to try but you will need a fairly good gfx card), but in the mean time here is another video. This shows one of Taylor Petrick's PhysX demos running in the deferred renderer with real time shadow mapping. Models are from Dexsoft, Plants4Games and Robomaniac.
Hope you enjoy it!
Links to some of Taylor's PhysX blogs:
www.garagegames.com/community/blogs/view/18125
www.garagegames.com/community/blogs/view/18075
www.garagegames.com/community/blogs/view/17113
www.garagegames.com/community/blogs/view/17037
Hope you enjoy it!
Links to some of Taylor's PhysX blogs:
www.garagegames.com/community/blogs/view/18125
www.garagegames.com/community/blogs/view/18075
www.garagegames.com/community/blogs/view/17113
www.garagegames.com/community/blogs/view/17037
#2
09/13/2009 (10:36 am)
Will this become a recource anytime soon? ;)
#3
09/13/2009 (12:30 pm)
If I release my PhysX stuff, I'll probably be selling it. I'm not sure what Adrian has in mind for his rendering code though.
#4
Matt - my main priority right now is working with some fellow Torquers to try and put together one seriously cool demo level (high ambitions!), out of which will hopefully come various code packs and art packs from each of us. And just to reiterate what Taylor is saying, there are two separate resources being shown off in the video, not just mine.
09/13/2009 (1:14 pm)
CSMP - thanks man, that is high praise indeed, although really the only improvement over my last blog is the inclusion of the PhysX resources, which is Taylor's work not mine!Matt - my main priority right now is working with some fellow Torquers to try and put together one seriously cool demo level (high ambitions!), out of which will hopefully come various code packs and art packs from each of us. And just to reiterate what Taylor is saying, there are two separate resources being shown off in the video, not just mine.
#5
09/13/2009 (6:39 pm)
Alrighty Then, it Looks Pretty Nice.
#6
09/13/2009 (6:41 pm)
I figured it would be multiple resources, either way both look awesome and compliment each other very much.
#7
GG dropped the ball on the PhysX implementation in T3D. Perhaps Taylor can get T3D and some cash for his work as trade from GG so that T3D can have a decent Physx implementation. ..??? ..Sorry GG, but T3D's current PhysX is half baked IMO.
09/13/2009 (9:23 pm)
GJ!GG dropped the ball on the PhysX implementation in T3D. Perhaps Taylor can get T3D and some cash for his work as trade from GG so that T3D can have a decent Physx implementation. ..??? ..Sorry GG, but T3D's current PhysX is half baked IMO.
#8
09/13/2009 (11:11 pm)
Im agreeing with EB, i wish the made a physx dialog to apply to your objects, (IE you could select an object and set it to float on water, break when shot at, etc.) That would have made my little eyes twinkle ;)
#9
09/14/2009 (1:20 am)
@eb Can we really say that till Torque3D goes Release?
#10
..but yeah, I think I can make a bet on that because it is a bet that I would appreciate losing...yet I fear that I will win anyways.
09/14/2009 (1:29 am)
OmegaDog, I know that I shouldn't be so blunt and hard-edged...but yeah, I think I can make a bet on that because it is a bet that I would appreciate losing...yet I fear that I will win anyways.
#11
09/14/2009 (10:27 am)
Im agreeing with EB about the implementation, But i think they did a fantastic job on the demo and everything.
#12
09/14/2009 (12:31 pm)
that is some pretty slick work Taylor
#13
09/14/2009 (4:12 pm)
well I have to agree with eb, I was a diehard for physx, but with t3d, I'm using bullet, in the time left till release of t3d, I cant see any real improvement in the implementation, when Taylor releases, I'll port his implementation into my t3d build.
#14
Artists PhysX is what I want! And even though Apex is slowly making it way on to the scene the Plugins have started to move in this direction.
Last time I looked Artists are responsible for producing Torque3D PhysX assets. Hmm you guys know that the Forest Kit has floaty boxes :)
09/14/2009 (5:04 pm)
You want stuff like in the average FPS that would be best for internal Torque3D/bullet to handle small fry stuff!Artists PhysX is what I want! And even though Apex is slowly making it way on to the scene the Plugins have started to move in this direction.
Last time I looked Artists are responsible for producing Torque3D PhysX assets. Hmm you guys know that the Forest Kit has floaty boxes :)
#15
thats a nice UT3 video, but we working with T3D.
I had(still have) floaty physx boxes in tgea 171....
09/14/2009 (6:15 pm)
you still cant mount a vehicle if physx is enabled, you walk right through it........thats a nice UT3 video, but we working with T3D.
I had(still have) floaty physx boxes in tgea 171....
#16
09/15/2009 (3:44 am)
Its interesting that there are more T3D users posting here than TGEA users, since this is really aimed at TGEA! It would be nice to see a similar video to mine and Taylor's but done with T3D with PhysX and dynamic lighting/shadowing, just to see how our work compares to the pros;)
#17
Unfortunately all the PhysX Pros are drunk(AGDC) thus the lack of comments from them so I guess its your TGEA(MOD) for the win!
09/15/2009 (3:58 am)
Adrian I forgot to say I love your work and Taylor's too.Unfortunately all the PhysX Pros are drunk(AGDC) thus the lack of comments from them so I guess its your TGEA(MOD) for the win!
#18
Does this break any other render-able objects/classes?
09/15/2009 (12:33 pm)
How radically different is the rendering pipeline here? Does this break any other render-able objects/classes?
#19
Don - those are really tough questions but I'll try my best!
2nd question first, yes there will be features that are broken, but I don't know what most of them are as it will be stuff in TGEA that I haven't used yet, sorry if that's a really bad answer! At my previous blog it supported enough features to run the Stronghold demo, but that's as far as I've got. Since then all I've managed to do is move it up from 1.7.1 to 1.8.1 so I can play with some of Taylor's PhysX code. Custom materials is the obvious thing that I know is going to give me a big headache, but from now on, what new features get added will be driven by what is needed to support our demo level. Its still very much a work in progress, an experiment and a learning exercise for me (I didn't know how to use the stencil buffer until a few weeks ago!), that started out as an attempt to understand what this GPU Gem was was going on about: http.developer.nvidia.com/GPUGems2/gpugems2_chapter09.html since I am a big fan of that game.
1st question - its completely different. With a forward renderer (standard TGEA) you basically run a render pass per object per light that affects the object, into the frame buffer. The light manager limits how many lights are allowed to affect an object to stop the number of passes exploding if you have a scene with loads of dynamic lights in.
With a deferred renderer you ignore the lights and just render a pass per object with a very simple shader into a minimum of three render targets, one for albedo (unlit colour), one for depth and one for normal. These are the multiple render targets, MRTs. You then apply all lights and materials at the end as a 2d post processing effect, reading the albedo, depth and normal per pixel out of the MRTs and using them as the input to your lighting equation. Actually games that use DR use 4 MRTs, but three is the minimum you can get away with. Effectively you decouple the number of objects from the number of lights so you don't get the explosion of render pass per object per light, so most of my demos so far are actually pretty poor cases for DR because they only have one or two lights in, for example indoor scenes in Stalker have on average 50 lights per frame (only a few will cast dynamic shadows though). Also note that no matter how complex your scene a DR only runs the lighting equation for visible pixels.
I should also say that there are some inherent limitations to a pure deferred renderer to do with translucency and antialiasing, talked about in the article above, which are solved in a newer more sophisticated approach to deferred rendering called light pre-pass rendering, as used by, cue drum roll, T3D.
[Edit - I should also say that other people are involved in the demo I am mentioning but I don't know if they want me to mention their name yet so I won't. However, everyone elses contribution will work independently of my DR stuff in standard TGEA forward render mode as well so if my stuff turns into a grahics card exploder you can still enjoy their stuff, after you have replaced your exploded gfx card ;) ]
09/15/2009 (5:00 pm)
OmegaDog - lol, forgot about GDC, well its a hard life for some, I bet there's not a decent pint of warm beer to be found;)Don - those are really tough questions but I'll try my best!
2nd question first, yes there will be features that are broken, but I don't know what most of them are as it will be stuff in TGEA that I haven't used yet, sorry if that's a really bad answer! At my previous blog it supported enough features to run the Stronghold demo, but that's as far as I've got. Since then all I've managed to do is move it up from 1.7.1 to 1.8.1 so I can play with some of Taylor's PhysX code. Custom materials is the obvious thing that I know is going to give me a big headache, but from now on, what new features get added will be driven by what is needed to support our demo level. Its still very much a work in progress, an experiment and a learning exercise for me (I didn't know how to use the stencil buffer until a few weeks ago!), that started out as an attempt to understand what this GPU Gem was was going on about: http.developer.nvidia.com/GPUGems2/gpugems2_chapter09.html since I am a big fan of that game.
1st question - its completely different. With a forward renderer (standard TGEA) you basically run a render pass per object per light that affects the object, into the frame buffer. The light manager limits how many lights are allowed to affect an object to stop the number of passes exploding if you have a scene with loads of dynamic lights in.
With a deferred renderer you ignore the lights and just render a pass per object with a very simple shader into a minimum of three render targets, one for albedo (unlit colour), one for depth and one for normal. These are the multiple render targets, MRTs. You then apply all lights and materials at the end as a 2d post processing effect, reading the albedo, depth and normal per pixel out of the MRTs and using them as the input to your lighting equation. Actually games that use DR use 4 MRTs, but three is the minimum you can get away with. Effectively you decouple the number of objects from the number of lights so you don't get the explosion of render pass per object per light, so most of my demos so far are actually pretty poor cases for DR because they only have one or two lights in, for example indoor scenes in Stalker have on average 50 lights per frame (only a few will cast dynamic shadows though). Also note that no matter how complex your scene a DR only runs the lighting equation for visible pixels.
I should also say that there are some inherent limitations to a pure deferred renderer to do with translucency and antialiasing, talked about in the article above, which are solved in a newer more sophisticated approach to deferred rendering called light pre-pass rendering, as used by, cue drum roll, T3D.
[Edit - I should also say that other people are involved in the demo I am mentioning but I don't know if they want me to mention their name yet so I won't. However, everyone elses contribution will work independently of my DR stuff in standard TGEA forward render mode as well so if my stuff turns into a grahics card exploder you can still enjoy their stuff, after you have replaced your exploded gfx card ;) ]
Torque Owner CSMP
MP Studios
I have to admit, You are making me want to get into TGEA... but I think I can still wait a little longer, as long as you don't come out with anymore videos!! lol.
Awesome I'd give you a 10 out of 5 stars but they removed the rating system.
Keep up the good work, whenever I do happen to move on to TGEA this will be first on the list!