Deferred Rendering in XNA 4 and SSAO with Normals
I finally got around to writing the rest of the tutorial, it’s fairly big but it’s worth it.
The tutorial covers Deferred Rendering with Directional Lights, Spot Lights with Shadows, Point Lights with Shadows and SSAO which takes Normals into account.
Unlike the previous tutorials where I assumed the reader was around intermediate level, this tutorial was written with the beginner in mind, though that doesn’t mean it moves at the pace of a snail.
Let me know what you think and what I should do for the next tutorial!
******* NOTE *********
This tutorial was written on a PC and requires a GPU capable of Multiple Render Targets with Independent Bit Depths! To check if your card supports this look for the D3D9 cap “D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS”. You can find it by looking in the caps viewer under the folder “PrimitiveMiscCaps” for your device.
If set to no then you will have to modify the Deferred Rendering code to make the targets have the same bit depth each by simply changing the 3rd Render Target of the G-Buffer to have a Surface Format of RGBA64 instead of Vector2. This may have consequences but I tested the final source code with it and it seems to work.
**********************

[...] I believe this is a great starting point for this project. I did find another tutorial over on The Cansin’s website, but this already had a few features implemented which I feel would be nice to implement [...]
Hi there, i dont know if you still use this place but im a lil stuck.
is there a limit to the size of the pointlight?, for me it seems to get stuck at about 400.0f it wont go any bigger
I used this tutorial to build the shadow maps in my iteration of a deferred rendering system. Once I had it all connected together, I ran into an issue where the generation of the shadow maps was producing some artifacts of bright white where there should be no lighting. I wrote a short post on the problem and how to fix it: http://chrisrolfs.com/2012/game-dev/code/deferred-rendering-shadow-artifact
@tiba: if you’re making the point light that large you might run into trouble with the cameras nearclip and farclip, make sure to keep those within a good range if you’re working with such large values for a point light.
@Chris Rolfs: I’m aware of the issue, the shadow factor needs to be saturated otherwise the overflow will affect results, your solution using min should be good.