Deferred Shading with Alpha support!!!
Deferred Shading with Alpha support!!!
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
*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
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
-
- Posts: 331
- Joined: Sat Sep 02, 2006 4:11 am
- Location: Michigan
- Contact:
Re:
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
- 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
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
Awesome.
By the way, I found this link about deferred shading...
http://www.talula.demon.co.uk/DeferredShading.pdf
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
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
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
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
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 )
Anyway, nice work, it's great to see the quality of programmers in this forum improving.
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
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
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 )
Anyway, nice work, it's great to see the quality of programmers in this forum improving.
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
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net