Deferred Shading with Alpha support!!!

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Deferred Shading with Alpha support!!!

Post by Nadro »

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.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

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
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

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.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Re:

Post by PI »

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
lostclimategames
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan
Contact:

Post by lostclimategames »

i should probably be wiki-ing this but what is deferred shading?
___________________________
For all of your 3D/2D resource needs:
Image
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Re:

Post by PI »

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
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

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
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

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
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

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;)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

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

Image

menu option: A,A,B,B
Image
Image
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

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:)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

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
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

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;)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

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!

Post by BlindSide »

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
Post Reply