Deferred Shading with Alpha support!!!

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Deferred Shading with Alpha support!!!

Postby Nadro » Mon Jun 23, 2008 3:49 pm

Hi, I create example Multi Lighting (6 Lights one per pass) Deferred Shading for Irrlicht (Direct3D9 and OpenGL are supported). I tested it on my Radeon 2600 PRO and all works fine:) In example I include 2 versions of dwarf from Irrlicht SDK (one orginal and second is smoothed) for compare Deferred Shading with standard Forward Rendering. This is conclusion:
*On low poly scene (4 000 poly per frame Forward Rendering is faster than Deferred Shading)
*On scene with 35 000 poly per frame performance is very similar
*On scene with 100 000 poly per frame (standard in games) deferred Shading is faster than 6 passes Forward Rendering with VBO
I think than Deferred Shading is very very useful technique for games also Outdoor and Indoor, Forward rendering is only better for small demo scenes.

You can download it from:
http://nadro.net46.net/Demos/DeferredShading.zip
or:
http://www.sendspace.com/file/m2w60d
Last edited by Nadro on Thu Jul 31, 2008 11:41 am, edited 5 times in total.
Nadro
 
Posts: 1647
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Postby JP » Mon Jun 23, 2008 4:04 pm

The deferred version doesn't work on my work PC, just get a black screen... forward rendering seems to work ok..

But well done anyway! :lol:

Could you give some more info on what deferred shading is? Is it like doing one pass per frame and then combining them later or something?
Image Image Image
User avatar
JP
 
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK

Postby Nadro » Mon Jun 23, 2008 6:25 pm

You have NVIDIA card? In DirectX work properly? In OpenGL I add ATI_draw_buffers extension, so maybe GeForce don't work currently (I can't test it because I don't have GeForce). I will upload modified version also for GeForce cards today in night. Deferred Shading passes looks that: 1 Pass G-Buffer pass, and N-Pass for N-Light with draw only quad screen with G-Buffer infos.
Nadro
 
Posts: 1647
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re:

Postby PI » Mon Jun 23, 2008 7:36 pm

Hello!

Sounds pretty cool! It would be great to have innumerable light sources in irrlicht :)

I'd like to try it out but every time the archive seems to be broken!

Can you please check it?

Thanks!
PI
User avatar
PI
 
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Postby lostclimategames » Mon Jun 23, 2008 7:51 pm

i should probably be wiki-ing this but what is deferred shading?
___________________________
For all of your 3D/2D resource needs:
Image
lostclimategames
 
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan

Re:

Postby PI » Mon Jun 23, 2008 8:06 pm

It renders a scene:

- 1X with diffuse textures
- 1X with normal maps
- applies lighting on the screen-space (why to calulate lighting on an object if not even being on the screen or just some parts of it are visible?)
- mixes these frames within a post process

Pros:
Theoretically innumerable lights
Worth to use with large scenes, many lights, because it's relatively fast

Cons:
Slow for smaller scenes (compared to forward rendering)
Transparent/Opaque objects are problematic to render

Am I right, guys? :)

Cheers,
PI
User avatar
PI
 
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Postby dlangdev » Mon Jun 23, 2008 8:39 pm

Very nice, thanks for sharing the code.

Awesome.

By the way, I found this link about deferred shading...

http://www.talula.demon.co.uk/DeferredShading.pdf
Image
User avatar
dlangdev
 
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR

Postby Halifax » Mon Jun 23, 2008 8:56 pm

Wow, amazing deferred shading example Nadro. Surprisingly I am running the deferred shading example, in D3D9, with the hi-poly scene at 8 FPS with a screen size of 1024x768, and I only have an ATI Raedon 200M Xpress. By the way with the same settings, but only forward rendering I only get 4 FPS.
TheQuestion = 2B || !2B
User avatar
Halifax
 
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Postby Nadro » Mon Jun 23, 2008 10:08 pm

Hi, I check the archive and is ok, I downloaded archive and unpacked it and all unpacked properly, You try redownloaded file, maybe it was temporary server problem. Who can test it with GeForce cards? In next version I will improve problem with poor precision of RTT Normals;)
Nadro
 
Posts: 1647
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Postby dlangdev » Mon Jun 23, 2008 10:15 pm

Spec: Nvidia 8500
menu option: A,A,B,A

Image

menu option: A,A,B,B
Image
Image
User avatar
dlangdev
 
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR

Postby Nadro » Mon Jun 23, 2008 10:23 pm

Thanks for test:) So, ATI_draw_buffers extension activate in Cg shader dosn't cause conflict with ARB_draw_buffers for NVIDIA cards:) BTW. You have got very good results on Your GF8500, better than Me on Radeon 2600 PRO with unfinished DirectX drivers:)
Nadro
 
Posts: 1647
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Postby dlangdev » Mon Jun 23, 2008 10:28 pm

Have you tried shadowmaps?

Not sure if FPS will still be that high if shadows were calculated into it, though. Coz the lights are too close together. I mean, the convexes are inter-penetrating, I read that's an expensive calculation.
Image
User avatar
dlangdev
 
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR

Postby Nadro » Mon Jun 23, 2008 10:40 pm

ShadowMaps will be of course work properly:) But it need n-pass for n-light if You need shadows from all lights, because we have to grab depth value;)
Nadro
 
Posts: 1647
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Postby BlindSide » Mon Jun 23, 2008 11:26 pm

Ooooh you beat me to it, I was about to make a tutorial on how to do this in Irrlicht. (Maybe I will change my mind now :P )

Anyway, nice work, it's great to see the quality of programmers in this forum improving.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby BlindSide » Mon Jun 23, 2008 11:30 pm

Ooooh you beat me to it, I was about to make a tutorial on how to do this in Irrlicht. (Maybe I will change my mind now :P )

Anyway, nice work, it's great to see the quality of programmers in this forum improving.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Next

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest