Quest3D Forum

Quest3D Topics => Demos => Topic started by: viik on March 22, 2009, 10:31:40 pm



Title: SSAO for Quest3D (Source code available for purchase)
Post by: viik on March 22, 2009, 10:31:40 pm
Screen Space Ambient Occlusion for Quest3D
(http://i6.photobucket.com/albums/y245/ViiKzzz/shadows_ssao4.gif)

Here, you can grab a new demo executable, source of the same scene with hybrid SSAO channel and documentation with tutorial:
http://3dvrm.com/ssao/ (http://3dvrm.com/ssao/)

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:
http://forum.quest3d.com/index.php?action=dlattach;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  ;) (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:
http://3dvrm.com/ssao/ssao_for_quest3d_documentation_&_tutorial_v03.zip

March 31, 2009
"SSAO for Quest3D" source code is available for purchase.
http://3dvrm.com/ssao/

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.


Title: Re: SSAO for Quest3D
Post by: Massimo1967 on March 22, 2009, 10:39:13 pm
great work


Title: Re: SSAO for Quest3D
Post by: daanwillems on March 22, 2009, 11:24:41 pm
Very nice demo Viktor!

I briefly checked the .exe at 1920x1200 / 2x ATI HD4870 / [email protected]:
~95 fps Regular shading + SSAO
~175 fps Regular shading without SSAO
~300 fps Regular shading without SSAO and Depth Render
~127 fps Only SSAO


Title: Re: SSAO for Quest3D
Post by: David Gulla on March 23, 2009, 01:00:46 am
Great Work Victor,

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

david


Title: Re: SSAO for Quest3D
Post by: oluv on March 23, 2009, 09:24:06 am
viktor, you are a hero!  :7


Title: Re: SSAO for Quest3D
Post by: jvo on March 23, 2009, 09:49:42 am
Very nice work man. Do you use a linear or logarithmic depth in the depth render?


Title: Re: SSAO for Quest3D
Post by: viik on March 23, 2009, 10:46:43 am
Linear, simply post projection Z coordinate.

Bytheway, this is a short shader to obtaine depth:
Code:
// 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();
}
}


Title: Re: SSAO for Quest3D
Post by: jvo on 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?


Title: Re: SSAO for Quest3D
Post by: micha_kobald on 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 ?


Title: Re: SSAO for Quest3D
Post by: viik on 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.

Micha
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.


Title: Re: SSAO for Quest3D
Post by: viik on 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).


Title: Re: SSAO for Quest3D
Post by: tom beddell on March 23, 2009, 12:54:19 pm
Global shader does not work with imprted animated objects yet, so I guess that is the problem.


Title: Re: SSAO for Quest3D
Post by: HuggyB on March 23, 2009, 12:57:44 pm
Impressive stuff Viktor.

What's next on your to-do list?


Title: Re: SSAO for Quest3D
Post by: micha_kobald on March 23, 2009, 01:01:06 pm
Quote
Global shader does not work with imported animated objects yet


arrgh holy crap.  |:( |:( |:( |:( |:( |:( |:(

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

@victor
i am your first costumer  :D





Title: Re: SSAO for Quest3D
Post by: viik on 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:
http://diva.3dvrm.com/ (http://diva.3dvrm.com/)

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 )))

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


Title: Re: SSAO for Quest3D
Post by: micha_kobald on March 23, 2009, 03:45:58 pm
i am sure it will work. Though i don't want to put a shader to every surface.
That's why i use a global shader approach -- i thought i could use.

So for now.

I can make a smart material or i use a OO object. the oo object consists of multiple single object. Glued together in later in quest3d. So they don't behave like normal hierarchy object.


Title: Re: SSAO for Quest3D
Post by: viik on March 23, 2009, 04:16:40 pm
Look like smart material can be nice solution for most of the users + apply SSAO as post-process.


Title: Re: SSAO for Quest3D
Post by: micha_kobald on March 23, 2009, 04:19:32 pm
btw: You have to make sure your expression for moving the objects i only called once a frame.
So setting the main loop to RCL once is much better. Just set the channels you need to be call multiple times, manual to "ignore tree count".


Title: Re: SSAO for Quest3D
Post by: viik on March 23, 2009, 04:29:39 pm
Yeah, you right, forgot about that.

Would be nice to add animated character, this is the strongest point of SSAO. Maybe I'll animate grass atleast, plus add shadow maps.


Title: Re: SSAO for Quest3D
Post by: Jose Luis Gallardo Llopis on March 23, 2009, 07:10:54 pm
Great work Viktor!!!  :-D :D

Very good work, and useful. Thanks for sharing your knowledge!!!


Title: Re: SSAO for Quest3D
Post by: tom beddell on March 23, 2009, 09:37:40 pm
Yes verrry nice work :)


Title: Re: SSAO for Quest3D
Post by: jvo on March 23, 2009, 10:32:32 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.
Yes, that is true, they use it for multiple things. But, lets say you have a scene with SSAO. This is scene 1. Now, lets say you have an exact same scene that's twice as big in all directions, scene 2. Lets say scene 2 is twice as far away from the camera. It should look exactly the same as scene 1. But, the depth range is twice as big. So, to get the exact same SSAO result, the log of the depth should be used.

As and extra advantage, storing the log depth in a 16 bit buffer gives you all the range you'll need. I'm not sure what kind of buffer you use now, but with log depth you could first store the linear depth in a single 32 bit channel texture. Then you can sample down, create a small poison disk in RGBA, take the log and store in a 16 bit 4 channel texture.
Quote
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).
Of course, I forgot about that.


Title: Re: SSAO for Quest3D
Post by: viik on March 23, 2009, 10:38:04 pm
Hmm... now I see what you mean, that's a good suggestion as now to handle situation as you describe i'm scaling depth, but it's more a "magic numbers" approach than a math. Thank you for good idea ! Need to try it.


Title: Re: SSAO for Quest3D
Post by: jvo on March 23, 2009, 10:43:43 pm
Hmm... now I see what you mean, that's a good suggestion as now to handle situation as you describe i'm scaling depth, but it's more a "magic numbers" approach than a math. Thank you for good idea ! Need to try it.
I remember reading it somewhere before. I think you are correct that crysis also stores a linear depth for other purposes, but SSAO should use logarithmic depth. Then you'll only need some "magic numbers" in the front maybe. A 16 bit logaritmic depth should easily reach all the way to the back of the scene.


Title: Re: SSAO for Quest3D
Post by: viik on March 24, 2009, 12:54:45 pm
Made a setup with smart material to capture depth and calculate SSAO, so now you don't need to manually put HLSL on every surface. Was very disapointed that smart material can't work with Nature Painter, so grass and stones was collapsed to single meshes.
I'll post a scene as soon as get smart material switching properly.

Check attached screen:


Title: Re: SSAO for Quest3D
Post by: diego on March 24, 2009, 01:37:50 pm
Fantastic Victor  :D


Title: Re: SSAO for Quest3D
Post by: viik on March 24, 2009, 02:51:50 pm
Guys, thank you for positive feedback!

Done. This is example with smart material, so no manual HLSL connection anymore. All geometry rendered without shaders. SSAO is applied at the end as a post-process -> "Render SSAO to screen".
I've included two smart materials, one for opaque objects and one for objects with alpha in diffuse texture. In Include folder you will find their source.

EDIT: One small issue - SSAO is now calculated for everything, including sky, I'll cut it in next update.


Title: Re: SSAO for Quest3D
Post by: parisj on March 24, 2009, 06:14:26 pm
kewl  :-D


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 03:20:49 pm
New demo with shadows is available on project's webpage:
http://3dvrm.com/ssao/ (http://3dvrm.com/ssao/)
"SSAO executable demo with Variance Shadow Maps"

Now on ground and statue SSAO is dispayed only in shadows.

New screeshot:


Title: Re: SSAO for Quest3D
Post by: oluv on March 25, 2009, 04:12:51 pm
viktor, it is looking great. with shadow maps the visual quality is really superb.
unfortunately i am getting shadow-artefacts on my 7950gtx. have a look at the attached screenshot. is it a limitation of the 7-series? are there some tweaks i can try to improve shadow-quality?


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 04:26:50 pm
Nope, partially it can be my fault, I made a precision settings for shadows too strong, but on 9x it's fine. Anyway this is easily can be fixed in shader.  Curious, will it be different on other cards or not.


Title: Re: SSAO for Quest3D
Post by: micha_kobald on March 25, 2009, 05:42:33 pm
looks perfect on my machine.


Title: Re: SSAO for Quest3D
Post by: Massimo1967 on March 25, 2009, 06:10:58 pm
Very perfect on my laptop.
Superb


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 25, 2009, 06:32:32 pm
Great work Viktor but i dont see any shadow. I have geforce 9800gx2. Could you give us a direct link? Also share the cgr for shadow occ example? Again amazing work  :-D


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 06:52:37 pm
Sorry, no direct link as I'm gathering statistics and these files would be updated, don't want somebody to get into the mess of different versions.

Second download link on project's webpage:
http://3dvrm.com/ssao/ (http://3dvrm.com/ssao/)

file name is:
ssao_island_v7.exe


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 25, 2009, 07:01:59 pm
Fantastic. It work fine. could you pleaes share the shadow version?   :D


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 07:06:49 pm
You need shadows or SSAO?  ;)
SSAO is 100% the same as in previous one. Shadows is a different story, I've already shared shadows example:
http://forum.quest3d.com/index.php?topic=66112.0


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 25, 2009, 08:33:28 pm
Could you please share the occ with shadow example. It work very fine


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 09:07:25 pm
This is it:


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 25, 2009, 09:40:50 pm
I love you Viktor. You are a fantastic man. Thanks a lot for this.  :D I hope i could use it for my racing game. Is it possible to use this shadow map for a huge scenes? And if its possible how?  :D


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 09:51:42 pm
Nope, for big scene you need Cascade Shadow maps, but it can be mixed with Variance shadow map (one that is used in example).


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 25, 2009, 09:53:46 pm
Viktor when i publish you project it gave me error. Is it because its not for commercial use?


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 10:08:17 pm
What kind of error?


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 25, 2009, 10:17:37 pm
When i publish it with 4.2.3 and run the exe it give me this error. But in 4.2.2 it work fine.  ???


Title: Re: SSAO for Quest3D
Post by: Massimo1967 on March 25, 2009, 10:17:56 pm
is it possible to have smart materia with shadow map?
Thanks


Title: Re: SSAO for Quest3D
Post by: David Gulla on March 25, 2009, 10:21:52 pm
When i publish it with 4.2.3 and run the exe it give me this error. But in 4.2.2 it work fine.  ???

i have the same error... tried everything allready. standalone, installer and webview don't work, qviewer works. we have to resave in 4.2.2 and publish. thank got for the 4.x.x compatibility...



Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 25, 2009, 10:30:39 pm
Viktor is there any chance that we have Cascade Shadow maps in q3d. I dont see any example of it in q3d. Is it hard to add? It seams new q3d will have Cascade Shadow maps. Am i right?


Title: Re: SSAO for Quest3D
Post by: viik on March 25, 2009, 10:47:27 pm
Massimo1967
Theoretically yes, practically it's difficult as every big enought surface requires different treatment to minimize light bleeding. Something like PCF can be done with smart material. I think Micha did something like that. He is using VSM much longer than me.

I'm still using 4.2.2, this and other projects started with that version, don't want to switch to next one until they finished.

David
Sorry, didn't uderstood, did you managed to compile it finally or not?

It shouldn't be that hard, from programming point it's quite simple, there are a lot of discussion and example of it. But anyway it takes time.


Title: Re: SSAO for Quest3D
Post by: Massimo1967 on March 25, 2009, 10:56:30 pm
very thanks for reply.
Micha can you complete Viktor's work adding a smart material shadow?  ;)
Thanks


Title: Re: SSAO for Quest3D
Post by: David Gulla on March 25, 2009, 11:11:02 pm
no Victor, I didn't manage to compile it... there's somewhere something (how usual) that I can't fix. your stuff has no issues, there's something with the version interference or just with the 4.2.3 and above. I've had 4.0 and 4.2.1 installed, everything worked fine, with yours and other hybrids. then I installed 4.2.3 and the problems started to happen - unfortunately I got no time to completely remove quest and install again 4.2.1 pure. but I'm convinced it'd run...


Title: Re: SSAO for Quest3D
Post by: micha_kobald on March 26, 2009, 10:17:05 am
i get 30 fps with shadows at 1920*1200

8800gts quadcore at 3.2ghz vista 64bit sp1 enough ram


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 10:21:30 am
That's quite nice, this scene contains 656k of polygons, all of them are used for shadow calculation. Could be better if find a way to dramatically increas transform stage. I was reading about double speed rendering, when only depth is rendered, but not sure that it can be achived in Quest3D.


Title: Re: SSAO for Quest3D
Post by: oluv on March 26, 2009, 10:37:10 am
so when are we going to see some cool looking projects using viktor's SSAO?
for now i think i am still too stupid to integrate it into my own project, but i would love to see some other's work!  :-9


Title: Re: SSAO for Quest3D
Post by: micha_kobald on March 26, 2009, 10:45:18 am
i am still interested in the source license victor. When will you release it ?


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 10:53:22 am
Need to document code properly, I'm planning to finish it before weekend.

EDIT: Ohh.. need to finalise a store as well. So, that would be next week, monday-tuesday.


Title: Re: SSAO for Quest3D
Post by: jvo on March 26, 2009, 10:58:35 am
That's quite nice, this scene contains 656k of polygons, all of them are used for shadow calculation. Could be better if find a way to dramatically increas transform stage. I was reading about double speed rendering, when only depth is rendered, but not sure that it can be achived in Quest3D.
It should be possible with Quest3D. The video driver should pick this up automatically if the right state settings are set. So, it should work if you just disable color writes in the technique.


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 11:16:22 am
Thats exactly the isue, if I switch off the color write than rendering can be done only into depth texture (aka hardware shadow maps, 24bit), but we don't have ability to use it as a custom buffer in R2T. Am I missing something?


Title: Re: SSAO for Quest3D
Post by: jvo on March 26, 2009, 12:13:35 pm
Thats exactly the isue, if I switch off the color write than rendering can be done only into depth texture (aka hardware shadow maps, 24bit), but we don't have ability to use it as a custom buffer in R2T. Am I missing something?
No, that's a problem with DirectX 9 as far as I know. You can speed up depth rendering, but only to fill the z buffer, which you can't access. DirectX 10 should support reading back the z buffer.


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 12:21:08 pm
I mean, how then depth can be captured if color write is disabled? In Crysis they used hardware shadow maps surface, as you get a better speed rendering into it.


Title: Re: SSAO for Quest3D
Post by: jvo on March 26, 2009, 01:24:15 pm
I mean, how then depth can be captured if color write is disabled? In Crysis they used hardware shadow maps surface, as you get a better speed rendering into it.
Well, that's where DirectX 10 probably comes into play ;)


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 01:42:40 pm
You can render into 24bit under DX9 but not in Quest3D, nVidia is promoting this for along time, Ati has similar solution.


Title: Re: SSAO for Quest3D
Post by: jvo on March 26, 2009, 02:29:16 pm
But will it also fill the z-buffer that way? Or only the target buffer?


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 02:42:22 pm
Only target, might be this is a reson why we can't use it in Quest3D, as R2T channel is using frame buffer.


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 26, 2009, 05:29:05 pm
Viktor how can i remove the black spot around the spot light? I have a situation that my env is big but when i use a shadow as you know there is always a black circle boundry. Is there anyway to remove it?
Thanks


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 06:18:25 pm
Tweak two variables Shadow Far and Shadow Near. Can you post a screenshot? Maybe it's different issue.


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 26, 2009, 07:01:04 pm
I mean this


Title: Re: SSAO for Quest3D
Post by: viik on March 26, 2009, 08:25:13 pm
Yes, that's it, make Shadow Far bigger, ideally shadow Far and shadow Near should set a tight boundary of where your shadow casters\receivers positioned.


Title: Re: SSAO for Quest3D
Post by: ali_rahimi_3d on March 26, 2009, 08:40:25 pm
Is it possible to use 3 sets of this shadow for 3 train? I want to use it for a racing game. Maybe that way it work. Could you pleaes manage to do that?


Title: Re: SSAO for Quest3D
Post by: David Gulla on March 26, 2009, 10:46:30 pm
...I must bow in front of you Victor...
with a little tweaking, some forloops, rendertextures and your brilliant code I managed to create a huge scene with shadows, occlusion and DOF that is capable of rendering 1.2 mil of polys in 1600*1200 with a speed of 47fps (on a standard iMac! duo 2.8/hd2600 pro/4gb - a final user machine). just to let know that it works more than well. some editor grabs from the scene below...

d.


Title: Re: SSAO for Quest3D
Post by: Massimo1967 on March 26, 2009, 11:07:42 pm
david can you post a demo to try?
Thanks


Title: Re: SSAO for Quest3D
Post by: David Gulla on March 26, 2009, 11:11:15 pm
sure, but I have to compile just a part of the project... the whole thing is made for a customer = rights = problems. Ill prepare a demo during the weekend


Title: Re: SSAO for Quest3D
Post by: daanwillems on March 27, 2009, 12:00:00 am
Really cool scene with the addition of VSM. Even the better that it seems to scale well in more complex scenes, as David shows. Looking forward to the demo. Did you do any tests with large scale urban area's? As this is something that many people are aiming for.


Title: Re: SSAO for Quest3D
Post by: David Gulla on March 27, 2009, 12:31:48 am
not really, I made a circle falloff mask for the rendered shadowmap texture and made the sunlight move with the camera where the circle scales up and down with zoom and angles of the camera so you have the impression it is everywhere - the closer you zoom the more detailed shadows you have (the rendertexture saves just a small portion - i could afford it because of parallel sunlight shadows). all you have to do is to make the sunlight position and the blurring relative to the camera...
I can make a small test with an urban enviro... but first the project muss be finished.

d.

EDIT: when the camera is low, you'll see the edge of the circle falloff in the distance - I used DOF, the edge is blurred and the small gradient doesn't really disturb the eye


Title: Re: SSAO for Quest3D
Post by: viik on March 27, 2009, 09:01:29 am
Looks nice )))
Saw a small light bleeding on lager_SSAO+Schatten.jpg. To fix it, find a function ChebyshevUpperBound, it should be before vertex shader. Inside this function you will fin two important lines:
float   g_minVariance = 0.000001f; //This value should be as small as possible, make it bigger only if precision issue arrise. If you see a noise on surface of object, this is wrong self shadowing, make g_minVariance bigger. At the same time bigger g_minVariance, leads to light bleeding.

p_max = linstep(0.1f, 1, p_max); // This function will remove light bleeding in cost of shadow edge softness. Tweak first argument of function "0.1f", it should be in range 0..1.


Title: Re: SSAO for Quest3D
Post by: David Gulla on March 27, 2009, 11:14:08 am
thanks, fixed. the problem was my graphics card as well... on a nvidia, everything looks somehow better and runs faster (obvious)...
d.


Title: Re: SSAO for Quest3D
Post by: kwiatu on March 30, 2009, 02:39:26 pm
Hi all

I've tried to implement SSAO on my models and after a few experiments I found out that it only works on models with textures? Is there any way that you could blend it right on to diffuse color. I'm dealing with big cad models and it would be great to try it on them. The other thing is that when I import my models in the scene which Victor provided the diffuse color of objects is always black. I'm not good in writing shaders - but is the information about object color stored in the fx code? and finally I not able to change the diffuse color of objects. Can some please help me out with a little explanation ???


Title: Re: SSAO for Quest3D
Post by: jvo on March 30, 2009, 04:43:42 pm
You could also just use a small (8x8) solid color textures on everything.


Title: Re: SSAO for Quest3D
Post by: viik on March 30, 2009, 05:49:31 pm
This can be easely fixed, you need to extend current version of smart material, that will have two techniques, existing one for rendering depth and new one that will read vertex color and output it. But approach suggested by Jos is easier to make.


Title: Re: SSAO for Quest3D
Post by: kwiatu on March 31, 2009, 10:34:31 am
Thanks for the reply

I did it the easy way and it works. My second problem is that I don't understant why antialiasing doesn't work on ssao. I can only have Multi Sample Type values of 0 and 1, values 2 3 4 5 6 don't work. It works on project without ssao so it should here. The funny thing is that it does smooth edges on values 2 3 4 5 6 but ssao is turned off even the channel switch is set for Diffuse + SSAO. Maybe it is a limitation of the hybrid channel.

but still it kicks......

Please help...


Title: Re: SSAO for Quest3D
Post by: viik on March 31, 2009, 11:07:23 am
Nope, I didn't set any of such limits, this has to do with render to texture channels. I'm usually setting AA in control panel and it works most of the time, except that sometimes when I switch in Quest3D between windows I'm loosing AA and perfomnace drops almost two times.

How much video memory do you have? Maybe this is a bottleneck in your situation. Try to set big AA using control panel, if it works than you should have enough memory and issue in channel logic or it's a bug.


Title: Re: SSAO for Quest3D
Post by: kwiatu on March 31, 2009, 12:23:30 pm
OK so I did as you told me - disconnected the channels resposible for AA in quest. Set AA in control panel to quality and everything works fine, so it's not an issue with hardware. I conneted everything back in quest so I can set aa. When I have the Rendermode set to only SSAO in your example - when I set the Multi Sample Type values in AA above 2 everything dissapers, even your objects ( the island statue, and so on...) it only works with values 0 and 1. I think it's a bug becouse it works on 2 values and doesn't on other. When you set aa in control panel it also works.

Looking for a solution.....

Thanks


Title: Re: SSAO for Quest3D
Post by: viik on March 31, 2009, 02:02:07 pm
"SSAO for Quest3D" source code is available for purchase.
http://3dvrm.com/ssao/

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 99USD, this price will stay valid until 15 of April 2009.


Title: Re: SSAO for Quest3D
Post by: Peter Hou on March 31, 2009, 02:08:04 pm
...rendering into 32bit "render to texture"

That could explain the issues with multi-sample AA. In my experience, it just won't work with 16 or 32 bit rtt - I believe that's also why it doesn't work with HDR.
If I'm wrong, please correct me :-)

Great work on the SSAO solution, Viktor! If I had a GeForce 8+ I would implement it in my projects at once :-D


Title: Re: SSAO for Quest3D
Post by: viik on March 31, 2009, 02:17:02 pm
I think you right, might be because of this, as rtt uses frame buffer for rendering. Using "copy backbuffer" command should solve this issue, but it will cut any non 8-bit data, so SSAO as well as HDR will not work properly.

I'm really disapointed by SSAO perfomance on 6x-7x cards, mostly is not because of the SSAO calculation itself but because of the triple rendering. Example scene has more than 600k polygons, that are rendered three times - depth, shadows, shading. I should make a more simple scene for testing on 6x and 7x cards.


Title: Re: SSAO for Quest3D
Post by: micha_kobald on April 01, 2009, 01:48:41 pm
victor check this out

http://www.mpi-inf.mpg.de/~ritschel/Papers/SSDO.pdf

Directional AO. This give you AO, shadows and if you want one indirect bounce of the light.
Interested in Programming this ?

This guy has a lot to offer

http://www.uni-koblenz.de/~ritschel/             


Title: Re: SSAO for Quest3D
Post by: viik on April 01, 2009, 02:17:56 pm
Yes, I tryed it, light bounce is pretty slow and version with cubemap is extremely slow. For some low poly, small test scene it will work ok, but not for real application. That was the reason why I droped two previous versions of SSAO, they where much slower than current one.

EDIT: And you need additional normal map information of your scene, that is useless for anything else except SSDO and some implementations of SSAO.

EDIT: I would actually mix SSDO with nVidia's HSAO, as it dosn't have most of the bug's from other techniques. But both techniques are very slow even for current high end PC's. Need to wait year or two.


Title: Re: SSAO for Quest3D
Post by: viik on April 01, 2009, 04:41:06 pm
I have an idea how further improve current implementation. Several developers are using frame coherency to distribute SSAO calculation among several frames. Simpliest solution is to calculate SSAO using 8 samples on one frame and calculate it again for another 8 samples on second frame but now using different radius. I'll try to extend it even further, take four frames and on each frame use a different rotation texture and global sampling radius togather with different downsampling. For example on first frame I'll calculate 8 sample, with big sampling radius, on 8th times smaller size downsampled depth buffer, than another 8 with smaller radius but bigger downsampled buffer and so on. Blur will be apllied to sum of this four SSAO images.
Getting less than 8 sample dosn't have much sense as the setup costs are the same for any number of samples.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 02, 2009, 09:22:34 am
The reprojection caching technique also seems promising, but you have to take into account that the reprojection can fail. There are several ways to handle this, but I've read that the best approach is too just use conditional shader code. If the reprojection is successful, you blend a few (2?) random samples with the old result and else you do a full sampling. It might be difficult to get this technique visually stable.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 09:31:15 am
I was planning to check coherency on per pixel level during SSAO summing phase. If camera or object is moving too fast, than only SSAO with smallest radius is taken into account, as it has a biggest contrast among others. This won't solve all artifacts, but one that left can be hidden by motion-blur. Potentially it will work faster than current implementation with quality of 24 samples.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: kwiatu on April 02, 2009, 09:55:48 am
Viktor - you are the best - finally it looks as I wanted it to look since begining....No more light baking...

Here are some images of the project I'm currently working on. The model has 5,5 mil poly and ssao works just fine 40-60 fps on a 8800 gtx.

(http://jl-consulting.pl/public/forum/quest3d/ssao/test1_low.jpg)

http://jl-consulting.pl/public/forum/quest3d/ssao/test1.jpg

(http://jl-consulting.pl/public/forum/quest3d/ssao/test2_low.jpg)

http://jl-consulting.pl/public/forum/quest3d/ssao/test2.jpg

(http://jl-consulting.pl/public/forum/quest3d/ssao/test3_low.jpg)

http://jl-consulting.pl/public/forum/quest3d/ssao/test3.jpg

(http://jl-consulting.pl/public/forum/quest3d/ssao/test4_low.jpg)

http://jl-consulting.pl/public/forum/quest3d/ssao/test4.jpg




Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 10:04:44 am
Looks beautifull! So many details  :)
BTW try to adjust contrast in hybrid channel, so non ocluded edges and flat surface would have almost the same shading. Occluded parts will still have a darker shade.

5,5 mil poly  :o Double render of such amount should dramatically drop fps. How much Fps you get when SSAO and depth render disabled?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: kwiatu on April 02, 2009, 10:15:38 am
Viktor I don't undarstand but it does not drop :) It's stays the same, maybe a 1-2 fps drop down. I don't see a diffrence. This is my first example. I need to fine tune the render loop and star adding SLOD on some objects, plus add a dynamic loading procedure, as I did in previous tests with quest, which showed large incrase of performance.It will take a couple of days.

 


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: micha_kobald on April 02, 2009, 10:18:32 am
just placed my order  :-D

Now if a new 4.3 beta with MRT's will come out today. It will be a perfect day !!!!!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: oluv on April 02, 2009, 11:18:29 am
jacek! zajebiste! finally a real-life example showing the real potential of viktor's SSAO. great!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: kwiatu on April 02, 2009, 11:24:36 am
Viktor I got one more question to you - how can I publish the project to WWW.  Well I know that you are not allowed to publish to www with custom channels, but maybe you know a trick? how to do it.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: tom beddell on April 02, 2009, 11:26:38 am
Ordered too, again, great work :)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 11:38:27 am
Viktor I got one more question to you - how can I publish the project to WWW.  Well I know that you are not allowed to publish to www with custom channels, but maybe you know a trick? how to do it.
I didn't used any custom channel only hybrid, it should work for WWW by this means. I'm not sure about other limitations of web publishing, concerning videocard related issue. Give it a try, I'll try to help you with that.

just placed my order  :-D
Ordered too, again, great work :)
Thank you for support!
You will get a confirmation email on adress used during purchase.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 02, 2009, 12:27:56 pm
Hi Victor, This is great work!

I've been testing it on some architectural models
and it is soooo nice when something "just works"!
No fuss, no hacking, no guesswork, just plug-it-in and get on with
being creative! Love it! 

I'll also be making a purchase! Will updates be free after purchase?

Animated/Skinned Character issue?

I've also been trying your shader on an animated skinned character
to see if it can handle it. What do you make of the ghost SSAO artefact?

Is this a limitation? (i.e. won't work on skinned geometry)
or does it just need some kind of workaround?

Let me know what you think.

p.s. I enabled flying with arrow keys again (+ mouse wheel for speed)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 01:07:59 pm
Quote
I'll also be making a purchase! Will updates be free after purchase?

Yes, I'm planning to improve performance for older video cards and might add some other fixes\additions. Just yesterday get an idea how to change appereance of SSAO by getting into account main light direction, sort of directional occlusion that Micha mentioned, but with faster implementation. Another benefits is that it can be applied as post-process and look better than current one.
Quote
Animated/Skinned Character issue?

I've also been trying your shader on an animated skinned character
to see if it can handle it. What do you make of the ghost SSAO artefact?

Is this a limitation? (i.e. won't work on skinned geometry)
or does it just need some kind of workaround?

Let me know what you think.

p.s. I enabled flying with arrow keys again (+ mouse wheel for speed)

Let'me check. It looks like depth render accounts for object movement but diffuse not, or vise-versa.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 02:02:47 pm
Skinned character needs a specific code for shader that renders depth. This is working version. It's not a smart material but simple material, not sure that smart works with skinned character at all.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 02, 2009, 02:12:32 pm
I don't mind doing it manually on skinned characters if that's what it takes.
Cheers!

p.s.
It really adds a whole different depth & feel to animated characters!
I'm going to have fun using your shader Viktor :-D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 02, 2009, 02:30:52 pm
Btw,
because the skinning version required slightly different code
will this 'SSAO skinning' version of your shader always be made
available in parallel with your other versions - whenever you release an update?

If it is too much of a 'branch' to manage the two verisions
maybe it could be merged into the same single project?, with an option
to enable or diable SSAO skinning?
(Just a thought)

..or maybe it now works on both kinds of geometry - 'animated skinned geometry'
and 'standard geometry' (expect as you pointed out, if animated & skinned u can't use Smart Materials)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: micha_kobald on April 02, 2009, 02:34:19 pm
i didn't looked at the code yet. But Quest reports if you have a skinned mesh to operate on.

if (UseSkinning==1)

This way you can maintain the same code basis.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 03:00:43 pm
Quote
Btw,
because the skinning version required slightly different code
will this 'SSAO skinning' version of your shader always be made
available in parallel with your other versions - whenever you release an update?
Current SSAO has three functional parts: depth render, SSAO calculation and "SSAO texture" usage. Only SSAO calculation is closed in hybrid channel, and that's exactly what you get when you buy a source. Depth render and "SSAO texture" usage can be done in many different ways, so they are opened from the beginning. Changes for skinned sharacter are related only to depth render it's not affecting SSAO calculation. At the same time it would be a good idea to gather in one group different examples of depth render - for skinned character, instanced geometry, transparent geometry. So that hlsl code would be available if somebody wants to create his own shader that will work with SSAO.
I was thinking to create ShaderFx template that will have a depth rendering as one of the techniques.

i didn't looked at the code yet. But Quest reports if you have a skinned mesh to operate on.

if (UseSkinning==1)

This way you can maintain the same code basis.

Oops.. I've deleted this part  :D
Such part of code:
float UseSkinning : UseSkinning = 1;
is a simple override of mentioned report?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 03:06:54 pm
One of the solutions would be to put example files with different kind of geometry\object on projects web page, you can always grab a latest version without going through forum pages.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Jose Luis Gallardo Llopis on April 02, 2009, 06:20:58 pm
Wonderful work Viktor,

i still work with 3.6 version so i can´t use your solution, even that, i have purchase the source of your work as a gift for your effort and work!!!  :D

I only have a query. It would be nice to have a more extensive documentation, with explanation of parameters, and some things you wrote on this post for each problem, all resume in one piece of documentation.

Thanks.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 02, 2009, 06:45:13 pm
Quote
Wonderful work Viktor,
i still work with 3.6 version so i can´t use your solution, even that, i have purchase the source of your work as a gift for your effort and work!!! 

I only have a query. It would be nice to have a more extensive documentation, with explanation of parameters, and some things you wrote on this post for each problem, all resume in one piece of documentation.
Thank you for support!  :)
I think it's possible to port it to 3.6.6 version, it has ability to render into 16-32bit texture (HDR target), maybe there are other limitations, not sure.
Good point about documentation, I didn't described hybrid settings and some aspects of usability. This is more important right now than new features.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: peterm on April 02, 2009, 10:55:06 pm
Great work Victor, also seriously considering buying, so question time:

1. fps seem to be good, but what happens to fps when getting lots of changes with camera, high speed action etc
2. shadowing and lighting techniques are going to be so-called 'out of the box' in next version of Quest, so where does SSAO fit into things? (given we don't really know yet what the next version will provide) that is; I'm wondering if I should hold off spending until I see what's in Quest.
3. I notice in the hybrid demo that when changing SSAO contrast there's a jump on the red value at 0.757, where lessor values creates a uniform change but when hit that value it jumps then theres no further contrast change.  Correct that: it seems to be wherever the G & B values are then the R value causes that contrast jump at that value.
4. what PS? all Shader3?

In the Skinning demo it looks like the demo needs to be packaged with a material resource? \ResourceFiles\DA243EC3-7D19-4B2C-B700-E919F4BF6D6E.cgr error message


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: micha_kobald on April 03, 2009, 09:52:28 am
@victor

Quote
Just yesterday get an idea how to change appereance of SSAO by getting into account main light direction, sort of directional occlusion that Micha mentioned, but with faster implementation. Another benefits is that it can be applied as post-process and look better than current one.

this would be gorgeous  :o

About support for older gpu -- i would prefer to see this as a otion. These cards are simple too slow < 8 class gpu. In most projects you can define the hardware. So i would prefer speed and features on modern gpu's rather than focusing on old gpu's

What do you think ?

@peter

1. more or less same performance due to the nature how it works

2. SSAO is just an addition. Out of the box shadows should be compatible if they are open enough. We all remember the old closed source shadows. So nobody known if this will be possible ( Remko ? )
Any way use viktors shadows they are really good. Perhaps we will see directional AO  ;)



Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 03, 2009, 10:46:06 am
I'll try to answer all of them:

1. There should be no difference, SSAO calculation is done in screen-space using depth of the scene and it dosn't depend on how fast depth is changing. The only exception is when you cull SSAO calculation for part of the screen, for example sky, than FPS can change, depending on how much of the screen is covered by sky.

2. It's for you to decide, my own preferency is to have a full control over effects that I'm using and be able to combaine them or apply to any kind of objects that I want. This is the reason why I decided to make it myself. I don't know how it will work with "out of the box" solution, let's hope that new version will have a much greater flexibility and ability to work as one shading system.

3. R should not be bigger than G, it's simply because of the smoothstep function in shader:
occlusion = smoothstep(R, G, occlusion);
function returns 0..1 value when in range of R..G, when R is bigger than G it works the opposite way.

4. Indeed, all shaders use SM3.0. It can be changed to 2.0, but there is no much sence to do that as 2.0 cards won't run it efficiently.

Fixed. I've included resources and used smart materials:


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 03, 2009, 11:31:49 am
@Micha
Quote
About support for older gpu -- i would prefer to see this as a otion. These cards are simple too slow < 8 class gpu. In most projects you can define the hardware. So i would prefer speed and features on modern gpu's rather than focusing on old gpu's

What do you think ?
GeForce 7xxx still has one but important advantage over newer cards - the easiest way of organizing stereoscopic visualisations. nVidia drivers for 7xxx GeForce supports variety of stereoscopic hardware (stereo-screens, projection-systems, HMD's, shutter-glasses). New drivers for 8 and 9 series doesn't have such good support for stereo-hardware.
One still can get a reasonable FPS with SSAO if use 8 samples, downsample depth buffer and make SSAO buffer itself smaller, only the bluring need to be fixed after this. Maybe later I'll make such demo. Another way to speed it up both for older and newer cards is to use frame coherency approach that we discussed with Jos. This should help as well.

With DO main dilema is to do the dot product of vectors (8 or 16 additional dot products per pixel) or sample cubemap. Dot product is preferable if you have a one light source, but cubemap can work with many light source at the same time. I'll definately try it.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 03, 2009, 11:55:44 am
Viktor, it certainly sound to me like you're the man to take up the challenge
of realtime-radiosity in Quest3d! (seeing as Geometrics  aren't interested).

I'll even give you the title to get you started:

"Viktorosity - Realtime radiosity for Quest3D"  ;)

No pressure  :-D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 03, 2009, 12:44:31 pm
Quote
"Viktorosity - Realtime radiosity for Quest3D"
:-D
I'm not sure that I able to make such. Was reading a lot on this topic, there are so many options and approaches, each one has huge list of pros and cons. I would rather wait for some "time-proven" solution and implement it. One that available now are too limited even for simple games.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 03, 2009, 01:18:58 pm
Unreal Engine 3 has been updated with realtime GI, but I have no idea which approach they took. Check out this video (jump to 1:40 for the GI stuff):
http://www.gametrailers.com/player/47568.html


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 03, 2009, 01:30:13 pm
It looks more like a static solution. No lights was moving or changing intencity in scene and no moving objects affecting\affected by GI is shown. Btw they don't say it's realitime. It can be mix of Illuminate Labs and Geometrix solution, for example they use calculate light using Beast but store solution using Geometrix's "photon maps" (spherical harmonics lightmap).


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 03, 2009, 01:39:15 pm
Ah yes, you're right :) - I found their press release (http://www.epicgames.com/press_releases/gdc2009.html):
Quote
Unreal Lightmass, a new global illumination solver, will be shown for the first time at GDC.  Unreal Lightmass produces high-quality static lighting with next-generation effects, such as: soft shadows with accurate penumbrae; diffuse and specular interreflection; and color bleeding.  Furthermore, Epic's new Swarm distributed computing framework enables lighting to be generated up to 10 times faster.  The new lighting features are bundled with Unreal Engine 3 and benefit all current and future engine licensees. Like all of Epic’s engine features, Unreal Lightmass is available at no additional cost to licensees.


It's still cool, though. I'd love to be able to generate that kind of lighting at the click of a button without having to unwrap and bake lightmaps.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: micha_kobald on April 03, 2009, 01:46:55 pm
btw. beast aka turtle can generate these spherical harmonics lightmaps.

If you use lua as bake script you can write what ever you want into your lightmap.

So I think they use turtle for the offlinepart. And Geometrix for the shader part.



Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 04, 2009, 01:38:26 pm
Good work Victor. The latest version seems a lot more practical than the one I had before. The effect is really effective and frame rate is ok too.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 04, 2009, 01:39:56 pm
Ah yes, you're right :) - I found their press release ([url]http://www.epicgames.com/press_releases/gdc2009.html[/url]):
It's still cool, though. I'd love to be able to generate that kind of lighting at the click of a button without having to unwrap and bake lightmaps.


They still unwrap :D Unless, offcourse they bake the radiosity into the mesh.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 05, 2009, 01:24:03 pm
Thanks Remko! It should be possible to make it even faster by using logarifmic depth as Jos suggested. Should help to cut additional math.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 05, 2009, 01:29:53 pm
I get about 5% increase here with my log depth version over the linear depth version. I do still have some artifacts to remove. I think the main advantage is that it makes the calculation a bit more logical and that the use of the depth buffer is a lot more efficient.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: ali_rahimi_3d on April 05, 2009, 07:41:16 pm
Viktor  in a last example you separate the occ from the shaders. Could you pleaes do the same thing for vsm? And are they still work with transparent hardware instancing?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 05, 2009, 08:16:03 pm
I haven't had a chance to try it yet - but wanted to know if the Skinning SSAO shader
could be used on an animated character that is also treated with a bumpmapping shader?
(or can only one HLSL object at-a-time be applied to an object)?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 05, 2009, 09:06:10 pm
Yes, you can apply only one HLSL, but one HLSL can have a number of techniques. For example your shader can have two techniques, one for rendering depth (that is used in example) and one that renders normal mapped diffuse and specular (in early non-smart materials example, each object had three techniques - for depth, shadow and diffuse). For making depth render for skinned character I took example from forum and cut all normal mapping stuff for simplicity.
I'm busy with documentation and new example right now, your character will have techniques for shadow and normal mapping  ;)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 05, 2009, 09:49:36 pm
cool bananas!  :-D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 05, 2009, 10:22:40 pm
We updated documentation on project's webpage:
http://3dvrm.com/ssao/ (http://3dvrm.com/ssao/)
Direct link to pdf:
http://3dvrm.com/ssao/ssao_for_quest3d_v02.pdf (http://3dvrm.com/ssao/ssao_for_quest3d_v02.pdf)
It's not complete yet, but has a full description of hybrid channel parameters and input values.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Anton Wintergerst on April 06, 2009, 06:16:33 am
Just purchased a copy :) When are your VSM shadows being released?  :D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 06, 2009, 06:43:09 am
It's already there, check this example:
http://forum.quest3d.com/index.php?action=dlattach;topic=66659.0;attach=128654
All needed code is inside HLSL channels, shadows use separate technique for rendering from light point and for final shading shadow calculation is commented. Soon, I'll post new example with skinned character.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 06, 2009, 01:49:30 pm
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  ;) (only for source code owners).

New version of documentation pack can be downloaded from project's web page:
http://3dvrm.com/ssao/
Or use this direct link to zip file:
http://3dvrm.com/ssao/ssao_for_quest3d_documentation_&_tutorial_v03.zip

PS: Does anybody interested in port for 3.6.6?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 06, 2009, 04:52:31 pm
Really cool by the way that a 'bug' in this shader actually enhances the depth. It reminds me of a paper that uses some optical illusion to enhance 3D perception. This looks more or less the same.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Jose Luis Gallardo Llopis on April 06, 2009, 06:02:12 pm
Hi viktor,

For me it would be great to have 3.6.6 version, as i´m still a 3.6.6 user.



Thanks and greatful documentation. Now it´s really professional. :D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 06, 2009, 06:13:25 pm
Hi Jose Luis,
Thank you, I hope that tutorial will really help more people to get SSAO running in their projects.

I'm not promising to port whole example, but it should be possible to port main SSAO channel group and scene similar to tutorial, so you would have a base to start from. Be aware that not all objects will work with it, skinned character and hierarcy animation will work, Nature Painter should work but without Hardware Instancing, I'll let you know if there are more limitations.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Massimo1967 on April 07, 2009, 08:10:45 am
IN SSAO I S POSSIBLE TO USE LIGHTMAP CAHNNEL AS Torque 3D?
THANKS
http://vimeo.com/2965415


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 07, 2009, 08:49:30 am
Really cool by the way that a 'bug' in this shader actually enhances the depth. It reminds me of a paper that uses some optical illusion to enhance 3D perception. This looks more or less the same.
Which 'bug' do you mean?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 07, 2009, 09:04:34 am
Massimo1967
I'm not sure that I understand you right. SSAO can work with lightmaps, it dosn't metter what you use - lightmaps, shadow maps, stencil and etc.
In that video they show only SSAO and lightmaps.

Jos van Ouwerkerk
I think he is referring to self-occlusion.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Massimo1967 on April 07, 2009, 09:56:44 am
id like to add a lighmap in stage 2. now it is possible use only one texture.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 07, 2009, 10:04:28 am
Are you using smart materials?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Massimo1967 on April 07, 2009, 10:05:35 am
yes i use smart material


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 07, 2009, 10:23:37 am
Assign lightmap to the second stage, just how it's "normally" done without SSAO. Take a look at attached example:


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 07, 2009, 10:40:37 am
Jos van Ouwerkerk
I think he is referring to self-occlusion.
Actually, it just hit me. He must be talking about the edge highlighting. This is not physically correct, but can enhance the depth perception. I've actually disabled it in my SSAO solution, because I'm not a big fan of it.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 07, 2009, 10:50:26 am
Ahh.. this one, It can be easily disabled by changing constant in source code. Practically you notice it when looking at pure SSAO, when mixed with diffuse it dons't "pop-up" but adds to the overal smoothness of occlusion, I would rather keep it.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Massimo1967 on April 07, 2009, 11:06:28 am
if you add  normalmapping in your lightmap example is complete fantastic
you work is very perfect


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 07, 2009, 12:15:35 pm
If you need normal maps with lightmaps you need to change smart material to use shaders for final render.
Wait for new example scene, there would be two example smart materials, one will be the same as it now, so it will use HLSL only for depth rendering and another one will use HLSL for for depth and final render.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 10, 2009, 02:35:06 pm
Here's the SSAO posted here in combination with new shadows in case you missed it in the other topic :D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 10, 2009, 02:53:19 pm
Remko - could you post the link to the other topic/thread ? thanks.
(I didn't know there was another one)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: murphy on April 10, 2009, 02:55:09 pm
http://forum.quest3d.com/index.php?topic=66763.0


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: oluv on April 10, 2009, 03:09:09 pm
remko, could you please post some close-ups from this model as well? i am curious to see how all the details look.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 10, 2009, 03:18:25 pm
Thanks Murphy!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 13, 2009, 10:28:58 am
The technique is based in screen space and the shadows adapt automatically so if you zoom in you get the same results. It looks more or less the same - but closer ;)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 16, 2009, 06:01:39 pm
This is a new example with skinned character and hierarchy animated object. Now all objects have shadows. You can use it as a source snippet for depth render. I hope Diego don't mind for using model of skinned character that he posted:
(http://i6.photobucket.com/albums/y245/ViiKzzz/sm_ssao_full_example.jpg)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 16, 2009, 06:03:47 pm
...and executable of this new example:


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Massimo1967 on April 16, 2009, 06:16:50 pm
why when you try to pubblish an exe it dosen't work?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 16, 2009, 06:18:27 pm
What kind of error you get?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Massimo1967 on April 16, 2009, 06:26:23 pm
unable to load startap channelgroup:


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 16, 2009, 06:36:05 pm
I see, hybrid is made in 4.2.2, it's need to be recompiled for 4.3, but there would be no need for that as it's gona be a part of new rendering pipeline. Just use it with 4.2.2 for now, at least I'm sure that other stuff in example will work as well.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 16, 2009, 06:52:59 pm
excellent!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 17, 2009, 08:19:28 am
Awesome work, Viktor!

I noticed that when I move the sun, the colour of the sunlight appears to affect the model. Is that just the light changing colour? It looks pretty convincing :-)

BTW, on a GeForce 7, the shadow still has some pretty bad artifacts as Olaf reported earlier (page 2 of this thread).


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 17, 2009, 08:19:34 am
Made I final conclussion about SSDO - its not possbile without having a normals of the scene, like in my old SSAO implementation that was much slower.
Another important point that is completely ignored in SSDO paper, is that when you use shadows SSDO becomes irrelevant as simple ambient occlusion attentuated by shadow and Lambert diffuse factor will behave as directional occlusion. This kind of attentuation is used on statue.
As to one bounce color bleeding, it would be nice to have but again, you need to have a normals of your scene rendered for calculation and you need a "source" for calculating lightbleeding itself, such source is actually your fully shaded scene. Btw, you will get lightbleeding only between verybright objects, bright pink and yellow boxes are used intentionally in paper. If I take a latest example as it is, the only place where lightbleeding would be seen is near white boxes. It's not really efficient to run quite expensive calculation and see results only for small portion of your scene.

I'm not stoping this research completely, I'll add normal maps as before and build example, but really not sure that it will run with acceptable performance.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 17, 2009, 08:23:58 am
Quote
I noticed that when I move the sun, the colour of the sunlight appears to affect the model. Is that just the light changing colour? It looks pretty convincing
I read color from cubemap at sun position, than its used as light color in final diffuse (and specular for some models) color, so it's gradually changing with sky.

Quote
BTW, on a GeForce 7, the shadow still has some pretty bad artifacts as Olaf reported earlier (page 2 of this thread).

Is this bug only on groundplane? Other model look Ok?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 17, 2009, 08:53:52 am
@ victor: I use a buffer that stores normal+depth. In PS 3.0 you can use the VPOS semantic to get the xy pixel of your fragment. With a small routine you can extract a a world space position based on depth so you have normal and position of all the pixels. This is a pretty efficient method to get access to position and normal.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 17, 2009, 09:04:58 am
Is this bug only on groundplane? Other model look Ok?

It appears to affect all models. I've attached a screenshot.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 17, 2009, 09:15:51 am
@ victor: I use a buffer that stores normal+depth. In PS 3.0 you can use the VPOS semantic to get the xy pixel of your fragment. With a small routine you can extract a a world space position based on depth so you have normal and position of all the pixels. This is a pretty efficient method to get access to position and normal.
I actually also implemented a SSAO that uses normal + depth. It is faster than my implementation of the orignal SSAO with the rotating box, since I can skip half the samples using the normal. This might depend on the scene though. I'm now using the stanford happy budda model to test. (500k vertices.) Another reason for me to also store the normal is that I use Quest 3.6.6, so I can't render to a single 16 or 32 bit channel texture. Better to use all channels of the render target.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 17, 2009, 09:31:51 am
@Peter
Can you help me to test one thing?
In the isle shader there is such line:
float   g_minVariance = 0.000001f;
try to change it to:
float   g_minVariance = 0.01f;
That should help. If it works, I'll update other shaders in example.

@Remko
I'll render depth and world space normal, this way I can sample sky cubemap properly.

@Jos
You can try to not skip but invert sample direction if dot product of normal and sample is negative.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 17, 2009, 09:40:51 am
@Peter
Can you help me to test one thing?
In the isle shader there is such line:
float   g_minVariance = 0.000001f;
try to change it to:
float   g_minVariance = 0.01f;
That should help. If it works, I'll update other shaders in example.

Yes, it worked! Very cool :-)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 17, 2009, 10:15:00 am
It means that 7xxx has a less precision in calculation or it's using some other format instead of G32R32F, I'm not even sure that it supports such render to texture format. But at least we know the cure now.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: oluv on April 17, 2009, 12:54:25 pm
on my 7950gtx the animated character is transparent. someone already mentioned this problem before.
the effect reminds me a bit of predator  :-D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 17, 2009, 01:47:19 pm
@Jos
You can try to not skip but invert sample direction if dot product of normal and sample is negative.
It actually works differently. I don't skip them. All samples are just placed front facing compared to the surface. And I just take half the number of samples. So, there is nothing to invert.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 17, 2009, 01:50:11 pm
Olaf, can you post a screenshot? It might be problem with actuall rendering.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 17, 2009, 10:02:11 pm
So much time wasted for Directional Occlusion... I'm not gona finish it and explaine why:

1) There is no reason to even try Directional Occlusion if you use shadow maps, just take into account shadow and lambert when you apply Smbient Ocllusion (as it's done in example already).

2) To produce noticable "directional" effect, your cubemap (sky for example) should have a huge contrast between sun color and sky color. Practically you just need to colors, some average sky color and sun color. Instead of sampling cubemap, just take a dot product with sun vector. Or you can render multiple lights into cubemap, but that's will affect contrast mentioned before.

3) General idea of directional ocllusion is to find random samples that will not be occluded and sample cubemap or lighting in that direction. But, the main draw back here is that occlusion function should be binary, this is where most of the SSAO methods fail in terms of visual quality as such approach produce not smooth result. With directional occlusion it's even worse - imagine 8 random sample, near edge at least half of them would be occluded and only remaining will sample cubemap. I've achived reasonably smooth result only by using 16 samples, at least half of them is actually wasted.

4) Produced colored occlusion is lost on models that don't have a simple "flat" color, for example on grass you would hardly notice any difference between Ambient Ocllusion and Directional Occlusion. It's all because shades of duffuse texture are mostly more colorfull than Directional Occlusion gradient.

5) Color bleeding is the only real benefit of that technique, but to compute it you need to have you scene lighting already available. To get a noticable result sampling radius should be big, much bigger than used for SSAO and this greatly effect performance. Only very bright objects will actually produce color bleeding, I assume that your scene would not be made from simple bright pink boxes. So you would have a textures and most of the objects woun't be very bright, the only place left for color bleeding is where sun light would brightly reflect to non lit surface, practically just a couple of places in the scene and maybe near bright reflectors.

6) Do you really want to use shader that is two times slower than current SSAO?  ;)

If anybody saw a discent implementaion of SSDO in "real" sene please let me know. I was so excited about SSDO technique that didn't saw such obvious limitations. It's better to spent time on improving blurring and documentation for current technique.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: oluv on April 18, 2009, 05:18:42 pm
vitkor, here are some screenshots. it seems not to be a problem related to SSAO alone, because the character is not rendered without SSAO either.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 18, 2009, 06:23:11 pm
Thanks Olaf! Bug is definately in character rendering, I've used normal mapping for him, something in the shader dosn't want to work on your video card. It's like when you compile HLSL and get an error, sometimes object is not drawn at all.
Can you try to recompile it? If it's compiled without error than try to comment these two lines at the beginning of the shader:
int UseTangent : UseTangent;
int UseBiNormal : UseBiNormal;

Model might already have tangents and binormals stored in vertex, maybe these commands lead to conflict, I had bugs on Ati cards because of this. All other stuff in shader is pretty obviuos and it's not too long. Which Quest3D version do you use?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 19, 2009, 06:14:13 pm
Documentation and example update
On project's web page you can find a latest version of documentation. Now with a code snippets for depth rendering of different objects. SSAO itself is updated with new blurring algorithm, new blur has a sligthly better quality. Example scene containe new version of Hybrid as well.
I've lowered precision for shadow maps, now it should work ok on 7xxx series.
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.

@Olaf
I've checked the model, it dosn't have pregenerated tangents and binormals so these two lines should be un-commented:
nt UseTangent : UseTangent;
int UseBiNormal : UseBiNormal;
I'll check what else can lead to such bug. Maybe it's a driver issue.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 20, 2009, 07:30:55 am
Hi Viktor,

I just downloaded V3.3.
In this version, the g_minVariance has not been reduced to 0.01f for GeForce 7 cards so the artifacts are still present.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 20, 2009, 11:51:16 am
I thought it would be enought. With lower value of variance, shadows start to disapear at contact point, I can make fix that bit than shadow edge will be not smooth. Anyway it's an issue with  Variance Shadow Maps not with SSAO. I see what else can be done to fix it.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 21, 2009, 01:33:45 pm
Decided to test multi-pass SSAO implementation, the idea is to use the same shader but get a much better quality by doing several passes of it. This is how it look like:
(http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-withoutSSAOsmall.jpg)
http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-withoutSSAO.jpg (http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-withoutSSAO.jpg) (bigger size)
"Science Fiction" scene with boring flat ambient term

(http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-single-passSSAOsmall.jpg)
http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-single-passSSAO.jpg (http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-single-passSSAO.jpg) (bigger size)
now single-pass SSAO is added (its a same SSAO as in example)

(http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-multi-passSSAOsmall.jpg)
http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-multi-passSSAO.jpg (http://i6.photobucket.com/albums/y245/ViiKzzz/Spacestation-multi-passSSAO.jpg) (bigger size)
and this is with multi-pass SSAO. Notice that radius of SSAO is bigger, shading is more smooth and there are more details (compare robot wheels). SSAO itself becomes more sharp, because much simplier blur is used to remove noise.
But if look at frame rate, it drops at least two times. That's ok it dosn't need to be interective. Multi-pass SSAO is for taking screenshots or "on demand render". I'll try to post today more complex scene.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 21, 2009, 02:29:43 pm
looks very good!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Massimo1967 on April 21, 2009, 02:31:59 pm
very niceeeeeeeeeeee!!!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: micha_kobald on April 21, 2009, 02:50:37 pm
coool !


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Mark van Heeswijk on April 21, 2009, 03:19:38 pm
wow! :o


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 21, 2009, 03:31:44 pm
@ Victor: Did you take a look at progressive SSAO? Progressive SSAO simply adds more random samples as the view remains still. This is nice because the frame rate is still good and as you freeze the camera quality increases.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 21, 2009, 03:43:35 pm
I was excited by this one:
http://www.gamedev.net/community/forums/topic.asp?topic_id=527170
But after seeing demo (link in the last post) not sure about it - it looks weird when SSAO starts to grow when camera stops. I want to try Epic's approach in Gear of Wars 2, they cache SSAO and reuse it when possible:
http://cmpmedia.vo.llnwd.net/o1/vault/gdc09/slides/GDC09_Smedberg_RenderingTechniques.pptx


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 21, 2009, 03:56:23 pm
I'm not sure it would be good idea to keep building up the quality, since it will be visible to the user. Using reprojection caching you can also determine whether you had a hit or a miss in the cache. So, you can use full sampling where the misses are and just sample 1/4 of the samples on the hits and blend those over a range of frames. That way you keep the image stable while trying to optimize the frame rate, instead of keeping the frame rate stable and trying to optimize the visual result.

Also, I'm not sure what you mean by 2 pass SSAO. Isn't that similar to just taking more samples in a single pass? I've actually made a 128 sample version that looks good and is obviously also is slow. Also intended for screen shot mode.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 21, 2009, 04:23:30 pm
It uses 9 passes now. Each pass takes 16 samples with different radius. Amount of samples is hardcoded, so for me it was easier to build separate passes. So practically its the same. I'll rewrite it to generate samples on fly, because currently sample taken in every pass are the same, with random samples quality should go up. I'm just not sure how to generate them - simple random is not nice soluiton, I need something like Monte Carlo generator to precompute them.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on April 21, 2009, 04:34:10 pm
You can easily find a random texture on the web that has a nice distribution. Probably DX or NVIDIA SDK should have one.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 21, 2009, 04:50:25 pm
Texture for samples rotation I already have. Samples themself are pregenerated, they are evently distributed over sphere, manually )) But you right, I can simply get more samples from such texture.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 21, 2009, 06:07:28 pm
Ah, ok, so 9x 16 samples. This is the result with my 128 sample version on the Stanford dragon. Speed is down to 27 FPS on a HD4850. I see some issues with the post process blur on the end of the tail. And it's not the most interesting model to test SSAO with :-\

By the way. I can't give away too much, but random spread over a sphere is not the best distribution. Most of the work I put it in the SSAO implementation is actually the generation of the sample points and the rotation vectors.

edit: tweaked some settings and uploaded a new image


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 21, 2009, 07:18:41 pm
"Evently distributed on sphere" - sphere is cut into 8 parts and equal amout of random vectors (two in my case)  generated for each part of sphere, kind of Poison distribution, but on sphere surface instead of flat grid. You can give each vector a semi-random length, I did that first, but in lates version it didn't affected shading that much. Makes sence to try it for multi-pass version.

Image on screeshot is very smooth, but it looks more like a kind of diffuse ligthing than ambient occlusion, maybe radius is too small?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 21, 2009, 08:45:51 pm
Evenly distributed over a sphere is still not optimal. Remember our talk on sampling for Gaussian blurring? Well, don't forget that diffuse lighting is usually formed using dot(N, L).

I agree it just looks like diffuse. (Well, it is the diffuse component we're working on.) I should try a different model. (And maybe turn of some of the lights.) The radius might actually be too large.

Edit: I've attached a test on a free house model from turbosquid. The filtering it not going very well; I've got some leaks around the windows.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 22, 2009, 06:50:58 am
I'm not rotating sampes around normal and I don't have a normal to attentuate occlusion by dot(N,L), so the only optimal distribution for me is over sphere.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 22, 2009, 09:48:10 am
Yes, you are right that it is optimal in that case. But, then you're ignoring the dot(N, L) factor. Of course you have to if you don't have normals. In any case, my point was that digging up some random texture might not be good enough with SSAO. The results are highly unstable before filtering, so it's worth the trouble to improve the sampling.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 22, 2009, 10:58:28 am
Totaly agree, difference between random generated and manually crafted texture that is used to rotate samples for every pixel is huge. Let me show you screenshot, to the left samples rotate using manually made texture, to the right random generated rotation texture is used. Left varian can be blured using 4x4 filter for right one even 8x8 is not enought. That's why nVidida is using 15x15 separable bilaterla filter to blur their HSAO. In both cases i'm using the same set of 16 vectors, that was manually made in the same way as texture, I'll take some time on weekend to make manually 128 or make app to do that.

EDIT: Screeshot is made using multi-pass SSAO in both cases.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on April 22, 2009, 11:02:53 pm
Yes, that was exactly what I was seeing. Scared the hell out of me ;) But, these days, many techniques in games are like this and rely on extra steps to make the result bearable. I actually wrote a simple program to calculate the samples. Well, not calculate, guess, it's a simple program. Takes about 5 hours to guess the sampling for 128 samples ::) (<- those are rolling eyes, but the forum software doesn't interpret that correctly...)
(http://forum.quest3d.com/Smileys/default/shocked.gif) (<- this one, with an img tag it works.)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 23, 2009, 12:22:33 pm
Hi Viktor,

I tried to publish your example scene with 4.2.3 and the latest beta 4, but they both return an error: "Unable to load startup channelgroup..."

Which version should I use?

Edit: Ah, sorry! :+ I see that it's 4.2.2 only. I thought we were supposed to be able to export old projects in newer versions of Q3D?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 23, 2009, 12:56:00 pm
Looks like it dosn't apply to hybrids.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: parisj on April 23, 2009, 01:31:22 pm
Quote
Looks like it dosn't apply to hybrids.

That is true.

A while ago I created a Hybrid channel (some unrelated component) in 3.6.6,
but had to remove it before opening the same project in 4.2.2.
(the project will not load, and shows the error displayed in the screenshot.)

I'll have to recreate the Hybrid for 4.2.2 if I want to use it again.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 23, 2009, 01:41:31 pm
This is such a cool setup, Viktor :-)

I have a quick question:

Is it possible to scale the sky and sun system in your example scene to support a large building? Something like 150m in diameter? I'm not sure which parameters to change.

Edit: So far, I've scaled up the Big_sphere object so it doesn't clip the building. Next, I've changed the Size Vector of the Sky to (5,5,5). Then I've multiplied GetSunPosition with a Vector (3,3,3) to move the sun further back. Finally, I've changed the Zoom on the Sun Camera's projection matrix to 275. Of course, the quality of the shadow is now quite poor and has an odd white border. Do you have any other parameters to increase the shadow quality?

Edit2: Changing the Range Scale on the shadow map definitely improves the quality although it's hard to find the right values...


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 24, 2009, 09:24:28 am
Any tips on improving the SSAO in a large architectural scene like this one?
I changed near clip to 1 and far clip to 2000

Settings in the hybrid channel:
Sampling radius scalar 0.996
R 0
G 0.7
B 0.46
First radius range 10
Second radius range 100
Amount of samples 16
Blurring depth threshold 0.005


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: micha_kobald on April 24, 2009, 09:53:49 am
your clip values seems to big.
try 0.1 - 100.

Or is there a specific reason why you use these values.
The less the clip range is the more precision you will get.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 24, 2009, 09:59:23 am
Well, it's a big scene - I need at least 500. Also, when I zoom out, the SSAO lacks detail when the far clip value is low. It's strange, but to me it looks like the quality improves when the far clip value is made larger ???


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: micha_kobald on April 24, 2009, 10:04:04 am
it think it is better to experiment with the contrast values. But i  have to admit it look sometimes better with large clip values.

If you have a big scene perhaps it makes sens not to calculate AO for object far away.
This can be done in using different clip values for the camera and the effect.
Just an idea


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: oluv on April 24, 2009, 10:16:35 am
peter, how does the scene look with textures applied?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 24, 2009, 10:16:35 am
@Peter
Sorry I missed your yesterdays post.
To make sky bigger, just change its size, as you did already. For the sun intself, open Sun folder (right side of the channel graph), then Values Motion folder, change scalar of vector-value multiplication and size multiplication. Don't change SunPosition call channel values, they are in range of 0..1, it's better to keep them intact as calculations in shaders expect them in such range.

White border is a light bleeding, this is a worst side of Variance Shadow Maps. To minimaze that, first you need to find proper Shadow Far and Shadow Near values, they are inputs for Range Scale calculation (you can find them under Shadow Map render channel caller). Check attached screeshots.
You can tweak them blindly or switch-off Channel Switch with Final Diffuse render and than switch-on "Use backbuffer rendering" in "Shadow map" render to texture channel (third child of "Shadow map render channel caller"). This way you will see a gradient of distance from light source to surface position. Tweak Shadow Near and Shadow Far so that you have a black pixels for closest surface to the light and white for furthest. Btw, gradient will have a color, if during tweaking it changes to completely other tone, like from pink to green than your range is too small.
Second step of illiminating light bleeding is to open HLSL shader of surface on whic bleeding occur and tweak these two lines:
float   g_minVariance = 0.00001f; - the smaller this values the less bledding should occur, but very small values will lead to precision error
p_max = linstep(0.5f, 1, p_max); - first parameter to linstep is affecting how soft shadow would be, light bleeding should disapear if you set it to 0.95f, but shadow will be crisp.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on April 24, 2009, 10:28:21 am
@Micha:
That's interesting - it almost looks like the exposure is changing :D

@Olaf:
Unfortunately, there are no textures. The architect wants a white model with just the lighting, but it's so big that it would take forever to unwrap and bake everything (more than 600.000 polygons). I hope I'll be able to get a nice result with SSAO instead.

@Viktor:
Thanks! I'll look into changing the settings you mention :-)
Is it possible to make the VSM self shadowing less gray? I'm pretty sure the architect is going to want it as white as possible with high contrast instead of the gray look. I'm using the shader from the moving white boxes in your example scene and as you can see, they also have gray sides...


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 24, 2009, 10:33:42 am
@Peter
Micha is right you don't need to use the same values of far near clipping plane for SSAO and camera. For SSAO they are used to for scaling depth and can be much smaller or bigger than camera near and far. It can look better with big radius, it all depends on a type of scene that you have, for example if your scene is a close up look to come detailed object thatn they should be small, so small depth details can be captured, if its an exterior than bigger values should make a better job.
Tweak these values in a first place, to get needed contrast and radius:
Sampling radius scalar 0.996
R 0
G 0.7
B 0.46
Then tweak near and far values of SSAO.

Btw, your scene will look completely different when you apply SSAO to textured surface, something that don't look nice right now, can become completely unimportant when you have textures.

Precise tweaking of SSAO, to get the best possible result is unfortunately can be done only by changing hardcoded constants in SSAO shader. Previous versions of SSAO was much easier to tweak but their performance was much lower, so spending more time on tweaking is a price you need to pay for a better performance.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 24, 2009, 10:39:50 am
That's easy, you need to tweak these values:
R 0
G 0.7
B 0.46

Try such values for example:


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Anton Wintergerst on April 30, 2009, 09:22:13 am
hey Viktor,
I need some help... am about to throw my computer through the window  |:(

I have purchased your source code, however to get things rolling i am first using the hybrid channel.
I also want the shadow maps, so I have used your ssao shadow hybrid example as a reference.

First issue is very strange, it doesn't even occur on my laptop(ati x1700, 4gb ram, dual 2ghz, vista 32bit), but on another laptop (geforce 9800gtx, 4gb ram, 2.2ghz, vista 32bit) and desktop (geforce 280gtx, 6gb ram, Oct 2.66ghz, vista 64bit) it appears to cut through the building and other geometry, as if all the polygons are flipped.
Now, whats even more weird is that all 3 computers run your demos flawlessly! so i can only assume it is a problem with geometry, but i cant work out what it is  |:( any tips/ideas from these snapshots?

Second issue, which has already been touched on by Peter and some others. I am working with a really large scene and I need the shadows to cover the whole scene without it looking ugly and losing quality. I know the shadow maps can only deal with so much detail, but surely there is a way around dealing with big scenes, or how have other people dealt with dynamic shadows for architectural scenes?

I hope you can give me some direction  :D thanks for making it even possible Viktor  :-D


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 30, 2009, 11:30:54 am
We found source of the bug.
If you switch-on AA in Quest3D swithc it of in Control panel and vise-versa. There are some kind of conflict between Quest3D's AA settings and AA settings in driver.

For very large scene you need something like Cascade Shadow maps. It's not that difficult to make them, but it's difficult to use them without good object manager. Let's see what new version of Quest3D will bring us.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Renzo on April 30, 2009, 03:19:38 pm
Not sure if this bug is similar to this one:

http://forum.quest3d.com/index.php?topic=62893.0 (http://forum.quest3d.com/index.php?topic=62893.0)

At the end of the post I found that there is a bug when using "Multi sample type" (AA)with "RenderTexture" channel.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on April 30, 2009, 05:12:14 pm
They are related, conflict between setting AA in Quest3D and externally in drivers, can be seen only when you use render to texture.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Anton Wintergerst on May 01, 2009, 04:39:33 am
Yes, thanks to Viktor we found the problem  :D
So the solution is to just not change the anti alias within Quest, unless you want to tell every one of your clients to disable setting it in their control panel   :7


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on May 02, 2009, 06:25:46 pm
I just noticed that the latest drivers from Nvidia have ambient occlusion as a setting in the control panel:
http://www.nzone.com/object/nzone_ambientocclusion_home.html


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on May 02, 2009, 06:44:53 pm
Yeap. They using profiles for some of the games, so it would render correctly. It's mainly used to add ambient occlusion to old games that didn't had it. Main issue is that content and rendering pipeline wasn't made with SSAO in mind, so it dosn't work nicely and simply blended on top of the rendered frame.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on May 20, 2009, 10:50:13 pm
Recently I was getting emails and pm with the same question - how much SSAO will effect performance? I hope that I did a clear explanation but in case if more people interested in this, let me explain it here as well.

This is a link to image with four screenshots:
http://i6.photobucket.com/albums/y245/ViiKzzz/SSAOandshadowsFPScomparison.jpg (http://i6.photobucket.com/albums/y245/ViiKzzz/SSAOandshadowsFPScomparison.jpg)

and this is just a part where you can easily see FPS and SSAO state:
(http://i6.photobucket.com/albums/y245/ViiKzzz/SSAOandshadowsFPScomparisonsmall.jpg)

The shading, shadows settings, SSAO settings and everything else except models is the same. Why the result is that different than? Why for the top model the difference in using or not using SSAO is only about 5 fps and for the bottom model it's almost 20?
Reason for this is that application bottlenecks are different and they different because top model has 462k of triangles and bottom one 146k. Because of this, application with top model is CPU and rasterizer limited and with bottom model bottleneck moves to pixel shader. So how much not only SSAO but any other technique effects performance is heavily depends on current place of bottleneck in your application and where exactly effect has a biggest impact. Your whole pipeline will work as slow as slowest part of it.
Nice thing about this is that even when you can't eliminate bottleneck at one place you still can get a better visual quality or add new feature, by doing more work at parts that are not used at full extent.

For example, you have a high poly mode, it's a bit tricky and time consuming to make it low poly and unwrap for lightmaps, so you migh be looking at using shadow maps. For shadow maps you will need to render your model at least twice, one time into shadow maps and second time to the screen, it's quite possible that bottleneck of your application will be at CPU and rasterizer, it means that you can do a lot of nice things using pixel shaders or start remodelling to get a better performance.
Let's make it a bit complex, you decided to add trees into the same project. Your trees are low poly and you already using pixel shaders a lot. Your bottleneck is already shifting towards pixel shaders because of all nice things that you use. What you can do here, is to make simplier shading for your trees but make a nice animation for them using vertex shaders. By doing like this you can balance your application in term of performance and visual quality. NVPerfHUD is your friend  ;)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on May 20, 2009, 11:02:18 pm
Quote
What you can do here, is to make simplier shading for your trees but make a nice animation for them using vertex shaders.
I'm actually getting pm's from my graphics card that he(or she?) doesn't like that vertex animation thing. Specially on top of those annoying alpha-rejecting "tree" things. It is about balancing in any case and the example you're giving is actually also one you should track with nvperfhud. Since shaders are getting unified these days, you can't move instructions between the vertex and the pixel shader to improve things. Objects moving using the vertex shader with alpha rejection have a lot more implications than just on the shader performance.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on May 20, 2009, 11:10:07 pm
If your vertex shading is far from being busy you can safely ignore her(him) )))
I agree with you, always test what you did, if you think that you know how this or another stuff will effect performance run a test, you'll be surprised quite often.

Quote
Since shaders are getting unified these days, you can't move instructions between the vertex and the pixel shader to improve things. Objects moving using the vertex shader with alpha rejection have a lot more implications than just on the shader performance.
Agree, vertex animated trees are not that good example. But you need to do it anyway to get animation, or animate vertices using CPU, that is not that fast as well.

Btw, Jos, I've used benefit of reusing z buffer information by not clearing it. Looks like indeed it can give you a boost. But main issue is that it dosn't work with AA as first render goes into 32bit render to texture (scene depth that I need later) and later you don't have any z buffer information to get z-culling. So, I was thinking, how we can get "double-speed z only render" in Q3D ?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on May 22, 2009, 04:58:55 pm
Btw, Jos, I've used benefit of reusing z buffer information by not clearing it. Looks like indeed it can give you a boost. But main issue is that it dosn't work with AA as first render goes into 32bit render to texture (scene depth that I need later) and later you don't have any z buffer information to get z-culling. So, I was thinking, how we can get "double-speed z only render" in Q3D ?
Actually, that's pretty easy, because the drivers should do that for you if you just disable the color write. It should then automatically switch to high speed z rendering. It should actually be a lot faster than a factor 2 on recent cards.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on May 22, 2009, 06:06:15 pm
But don't render any Alpha test geometry during this pass, right?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: haduken on June 06, 2009, 11:32:34 am
All source code has great because the drivers should do that for you if you just disable the color write.



_________________
Stereolithography (http://www.metrorp.com)




Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on June 06, 2009, 01:20:47 pm
But don't render any Alpha test geometry during this pass, right?
That is a good question. I actually think you can also include these in the early Z pass. But, you should use the clip instruction in the pixel shader instead of the fixed pipeline alpha test. (It's the way to go for DirectX 10/11 anyway.) I'm guessing the speed up still works if you do it like that. Still no access to the color buffer needed like that.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on June 06, 2009, 02:44:37 pm
Sounds logical, that's should work.
I assume that it works like this:
ColorWriteEnable = 0x00000000 to disable color writing
ColorWriteEnable = 0x0000000f to re-enable all color channels

because I've tryed it in Q3D 4.3 beta but didn't saw any difference in performance. Maybe something else was wrong.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: jvo on June 06, 2009, 05:19:14 pm
ColorWriteEnable = 0 should indeed disable it. For the other settings there are constants defined for the channels. Something like ColorWriteEnable = RED | GREEN | BLUE.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on June 06, 2009, 06:09:38 pm
Thanks! I'll try it.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Jochen Kranzer on June 09, 2009, 09:10:10 am
I hope that I did a clear explanation but in case if more people interested in this, let me explain it here as well.

Thank´s Viktor for this short and clear explanation!  :)
It helped me to understand what´s going on!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: perfect on June 23, 2009, 10:08:34 pm
Viktor
While the SSAO works fine in 4.2.3 editor after you publish the exe crashes on load (unable to load channel group). Is this because the hybrid needs to be compiled for 4.2.3?    If so are you planning to do that?

Thanks a lot!!


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on June 24, 2009, 01:34:52 am
Hi Rob,

Unfortunately I cannot fix that, hybrids dosn't work anymore in 4.2.3, I wasn't able to make it. Strange thing that Sky channel, that is hybrid as well, work fine, maybe because it was made in 3.6.6.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on June 24, 2009, 01:03:58 pm
A perfect alternative for Hybrids is the class system. There are a many of advantages. You can create multiple functions for your component, properties and instancing is much easier.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: Peter Hou on June 24, 2009, 01:16:19 pm
@ Remko:

Do you plan to completely remove hybrids in the future?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on June 24, 2009, 01:30:27 pm
Indeed, it makes the whole process much simplier. Right now, I just don't see a way on how to build and maintaine two versions - OO and non OO for SSAO and Outdoor Shadows Solution. Non OO version is needed as there are a lot of user who don't use OO yet.
But it's a good idea to rebuild SSAO hybrid into OO class, so it can be used in 4.2.3 as well.

I didn't used OO a lot and wonder is it possible or not to run through channel tree and apply shaders or certain logic only to needed channels?
For example, you have a channel tree with a lot of 3D objects and most of them are using physics or animation. Objects position need to be update only one time perframe, so if I render the same object several times during one frame (depth render, final shading, reflection and etc.) I'm getting into trouble as physics and animation get's updated several times. Just setting a "one time per frame update" is not really helping. The current solution is to update object's physic/animation, save object's motion matrix ones per frame and use it for rendering, all this done in channel graph and is quite time consuming task.
If with OO I would be able to go through channel tree, build a list of surfaces with links to corresponding textures, 3DObjectDatas, motion matrices and etc. and then use them for rendering that would be a solution. But what I saw so far is that 3dobject itself need to be OO to efectively use them in classes.
I know that it's like mixing two different concepts - channel graph and OO, but I can't use complete OO approach right now.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on June 24, 2009, 01:36:40 pm
Usually it's a good idea to have a 'update' branch and a 'draw' branch. If you reuse motiondata it is only calculated once.

It does not have to be completely OO. You can attach a channelcaller that contains the scene for example wich is a normal channel graph. I do recommend using global shaders whenever you can because they increase performance.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: remko on June 24, 2009, 01:37:29 pm
We have no plans removing Hybrids. The are just depricated, meaning that they are just there for backwards compatibility.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on June 24, 2009, 01:55:42 pm
Quote
Usually it's a good idea to have a 'update' branch and a 'draw' branch. If you reuse motiondata it is only calculated once.
This is how we actually solved it, but it takes a lot of time to rebuild existing channel graph to such setup. In this case OO would help to make initial setup easier, now in took about a day, as to separating update and draw branch - it took almost a week.

Quote
It does not have to be completely OO. You can attach a channelcaller that contains the scene for example wich is a normal channel graph. I do recommend using global shaders whenever you can because they increase performance.
If Update and Draw is separeted - yes. But if they are mixed, Global shader is updating motion and channel logic 5-6 times per frame. When Update and Draw is separated it works really nice. It's now used for final shading as well - there are many object that have the same material but need to be separate meshes because of physic.
I was hoping that using OO on channel graph, such separation can be done as well, without remaking channel logic manually.


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: tom beddell on June 24, 2009, 02:36:47 pm
Remko, did you get global shaders working with hierarchy yet?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: daiju on June 28, 2009, 06:32:49 pm
great    :)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: ali_rahimi_3d on July 21, 2009, 03:17:46 pm
could you add this shader to occ?


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: daiju on July 21, 2009, 08:46:43 pm
Very cool!     can speedtree trees like it in the AO? This will be very much looking forward to   8)


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: JHT on January 14, 2010, 06:11:59 pm
I see the hybrid channel is limited to 4.2.2. 

Is there any way for SSAO to work with 4.3 or higher?

Do I need to purchase the source code for it to work?

Thanks


Title: Re: SSAO for Quest3D (Source code available for purchase)
Post by: viik on January 14, 2010, 06:59:13 pm
Unfortunately Hybrids don't work in 4.2.3 and higher version. For higher versions you need to have a source code.