Pages: [1] 2 3 4 5 ... 16   Go Down
Author Topic: SSAO for Quest3D (Source code available for purchase)  (Read 56453 times)
March 22, 2009, 10:31:40 pm
Screen Space Ambient Occlusion for Quest3D

Here, you can grab a new demo executable, source of the same scene with hybrid SSAO channel and documentation with tutorial:

Approach used in this example might be difficult to use for projects with big amount of objects and for users not experienced with HLSL programming. There are way's to fix that using Smart Materials. Check thread for discussion on this subject. Example with smart materials:;topic=66659.0;attach=128636

Latest news:

April 21, 2009
Documentation and example update
On project's web page you can find a latest version of documentation. Now with code snippets for depth rendering of different objects. SSAO itself is updated with new blurring algorithm, new blur has a sligthly better quality.
Source owners will receive a newest version of source code by email, it containes clipping of pixels that don't need SSAO calculation, as for example sky.

April 06, 2009
Tutorial: “Adding SSAO to simple rendering pipeline”
Another documentation update, I've added section with step by step tutorial on how to setup rendering pipeline with SSAO from scratch. Tutorial is made for Hybrid channel, difference in steps if you use source code is subtle, but I'll add special part explaining it with a next update. If you can't wait, drop me email, I'll send you example  Wink (only for source code owners).

New version of documentation pack can be downloaded from project's web page rr use this direct link to zip file:

March 31, 2009
"SSAO for Quest3D" source code is available for purchase.

Benefits of having a source code are following:
- save videomemory by not using one texture of screen size resolution
- change size of downsampled depth texture to find the best quality\performance solution for particular project
- make SSAO buffer smaller than window size to improve performance (it will be resized back during blurring)
- port SSAO to any version of Quest3D that allows rendering into 32bit "render to texture"
- fine-tune SSAO's hlsl constants for specific project, to get better visual quality
- if your project has a different quality\performance setting, you can adjust SSAO quality settings in real-time as well
- get additional performance by calculating SSAO only for part of the screen, as you don't need it for the sky for example
- you get a technical support, we will help you to incorporate SSAO in your rendering pipeline

Current price is 149USD, this price will stay valid until 30 of April 2009.

Upgrade to PSSM is available for SSAO customers. Check for details.
March 22, 2009, 10:39:13 pm
great work
March 22, 2009, 11:24:41 pm
Very nice demo Viktor!

I briefly checked the .exe at 1920x1200 / 2x ATI HD4870 / Q9450@3.2Ghz:
~95 fps Regular shading + SSAO
~175 fps Regular shading without SSAO
~300 fps Regular shading without SSAO and Depth Render
~127 fps Only SSAO
March 23, 2009, 01:00:46 am
Great Work Victor,

thanks a lot for your effort... it needs much more than a big THX

March 23, 2009, 09:24:06 am
viktor, you are a hero!  Love it
March 23, 2009, 09:49:42 am
Very nice work man. Do you use a linear or logarithmic depth in the depth render?
March 23, 2009, 10:46:43 am
Linear, simply post projection Z coordinate.

Bytheway, this is a short shader to obtaine depth:
// Application matrix inputs
float4x4 object_to_clip : WorldViewProjection;

// Vertex shader input structure
struct in_vs {
float4 pos : POSITION;

// Pixel shader input structure
struct in_ps {
float4 clip_pos : POSITION;
float4 clip_pos_depth : TEXCOORD0;

in_ps depth_vs(in_vs input) {
in_ps output;
output.clip_pos = mul(input.pos, object_to_clip);
output.clip_pos_depth = output.clip_pos;
return output;

float4 depth_ps(in_ps input) : COLOR {
float d = input.clip_pos_depth.z;
return float4(d,d,d,d);

technique ssao_input {
pass P0 {
VertexShader = compile vs_3_0 depth_vs();
PixelShader = compile ps_3_0 depth_ps();

Upgrade to PSSM is available for SSAO customers. Check for details.
March 23, 2009, 10:55:20 am
If I remember correctly, Crysis uses logarithmic depth for SSAO. The idea behind this is too keep the depth changes on the same scale for different distances. I noticed that the shadows fade away when you come closer to it. Is this intentionally?
March 23, 2009, 12:19:45 pm
very good work !

I noticed some problem hierarchy objects. They are not rendered correct.

I used a global shader for my objects. Perhaps this is the problem. i will look into it later. Did you tested on hierarchy objects. ?

did you made your mind about how much a source licenses would be ?

* Aufzeichnen.JPG (186.09 KB, 1436x1002 - viewed 955 times.)

March 23, 2009, 12:35:53 pm
If somebody has a simple animated object with hierarcy that can be added to example, please post it here and I'll put it into next version of example scene.

No, I didn't test it with hierarchy objects, as SSAO itself dosn't care about nature of geometry. This bug might happen because vertex shader (used for object rendering and depth) dosn't account for hierarchy. For example, grass and stone vertex shaders are the same and specifically made for hardware instancing but they are quite different to Athene and isle shader. Btw, there was a topic that global shader dosn't work properly with collada geometry anymore, that's why I didnt used it in example + grass has transparency, so it cannot be rendered using global shader.
Source license price is 99USD.

Upgrade to PSSM is available for SSAO customers. Check for details.
March 23, 2009, 12:52:48 pm
Jos, sorry, didn't saw your post. They say in docs and presentations that linear depth is used, as they use it for bunch of othre effects including one that reconstuct world position of pixel from depth (you need linear depth to do it). Maybe specifically for SSAO it's rescaled.
I'm rescaling depth influence for different distance. Shadows fade away because sampling radius has a maximum boundary, this is needed to keep good performance. So, when you get close to an object small cavities become too big for sampling radius to capture them. I can rescale depth in such a way that shadows near camera won't be white, but they will turn into plain gray color (half-occlusion).

Upgrade to PSSM is available for SSAO customers. Check for details.
March 23, 2009, 12:54:19 pm
Global shader does not work with imprted animated objects yet, so I guess that is the problem.
March 23, 2009, 12:57:44 pm
Impressive stuff Viktor.

What's next on your to-do list?
March 23, 2009, 01:01:06 pm
Global shader does not work with imported animated objects yet

arrgh holy crap.  Frustrated Frustrated Frustrated Frustrated Frustrated Frustrated Frustrated

when will still finally be resolved. We are waiting almost a year now for a full featured global shader.
i checked almost all basics shaders. And they don't work

i am your first costumer  Cheesy

* hierachy_test.rar (2.82 KB - downloaded 616 times.)

March 23, 2009, 02:44:57 pm
Impressive stuff Viktor.
What's next on your to-do list?

Currently we are working on new release of our software for database developers:

As to Quest3D related things, I'm busy right now with one demo project. One of the features would be a nice shallow water near beach mixed with deep ocean water. If the results would be flexibly enought I'll pack it as a product.
I'm still planning to build deffered render as soon as we get ability to use MRT and real render to texture (currently RTT channel uses frame buffer, this is why we limited in RTT size).
Side results as motion-blur, depth-of field and soft particles.
Another project will be a sky render system, based on athmoshperic scatering model. I want to make it in such a way that you can apply scatering to any object in scene (as it done in Crysis) not only for getting sky color.
Want to experiment with GUI rendering based on vector data, so it can be properly scaled for any resolution and screen aspect rate, and it has much lower footprint on videomemory if GUI is quite complex.
Megatexture - would be a very nice asset for big exterior projects, only issue now is that market dosn't have editors that can easily work with extremely big textures.
Spherical harmonics lightmaps, want to make it for a long time, but i'm more inerested in dynamic lighting right now.

Not sure which one i'll do next )))

Attached example with hierarchy, I used very simple shader for easy reading. Try it with your geometry.

* SSAO Hybrid Hierarchy (3947.14 KB - downloaded 932 times.)

Upgrade to PSSM is available for SSAO customers. Check for details.
Pages: [1] 2 3 4 5 ... 16   Go Down
Jump to: