Here's the exact original scene without SSAO:
http://www.orandysoftware.com/user_files/decorg.jpg Download the images and compare it slide by slide. You'll find out some area would look more 3D.
Here's how I do it in C#:
1st. Render everything you want SSAO to affect using the depth shader to a RTT, else hide it
Code: Select all
WorldNode.SetMaterialType(depth.MaterialType);
tablenode.SetMaterialType(depth.MaterialType);
tablenode2.SetMaterialType(depth.MaterialType);
......
plantnode1.Visible = false;
fernnode1.Visible = false;
fernnode2.Visible = false;
smoke.Visible = false;
driver.SetRenderTarget(lum.rtdepth, true, true, new Color(0, 0, 0, 0));
scene.DrawAll();
2nd. Grab the texture and load it on the onscreen quad, applying SSAO as well.
Code: Select all
rtao = driver.CreateRenderTargetTexture(new Dimension2D(512, 512));
rtdepth = driver.CreateRenderTargetTexture(new Dimension2D(512, 512));
SSAO.Wireframe = false;
SSAO.Lighting = false;
SSAO.Texture1 = rtdepth;
ushort[] indices = { 0, 1, 2, 3, 4, 5 };
driver.SetRenderTarget(rtao, true, true, new Color(0, 0, 0, 0));
driver.SetMaterial(SSAO);
driver.SetTransform(TransformationState.World, AbsoluteTransformation);
driver.DrawIndexedTriangleList(Vertices, 6, indices, 2);
I think that's all. There's a post processing framework lying somewhere in the forum too, you can have a look at it.