SSAO (Screen space ambient occlusion) tests in jME

Real-time ambient occlusion implemented as a separate renderpass that can be added to any scene. Similar technique to the one in the crytek 2 engine. I havent gotten to the depth/normal dependant blur yet though, which will shape things up…







Animated:



without SSAO:

http://www.youtube.com/watch?v=-f3756ABrDU



with SSAO:

http://www.youtube.com/watch?v=hEGt1rth2g4



Boxes:



without SSAO:

http://www.youtube.com/watch?v=UsTHi1OjXzE



with SSAO:

http://www.youtube.com/watch?v=96dpFlCMmzo

very cool, the boxes example shows the effect very nicely.


Nice looks very promising.



Hellmaster.

Very impressive.

i'll dig up some nicer samples as well as release the code after i get the blur implemented, some optimizations done etc.

is this technique usually used to replace a shadow pass, or is it better used to improve the scene with light soft shadows, with additional shadow pass?

That looks great!!

since it's only providing ambient occlusion it's not casting any directional shadows, so it should be used together with some shadowing technique (like cascading shadow maps).

sweet  :-o

Impressive!

I could be one of the jME demos on the jmonkey site when done :wink:

Pretty cool :wink: Can't wait for this and the shadow mapping.

Don't try to isolate features like shadows and SSAO in render passes, I think it's better if they are more integrated with the core.

Momoko_Fan said:

Pretty cool ;) Can't wait for this and the shadow mapping.
Don't try to isolate features like shadows and SSAO in render passes, I think it's better if they are more integrated with the core.


Could you elaborate on that? How would you prefer it to be integrated?

Very nice :slight_smile:



I tried implementing it in jME once but didn’t have the time or skills to get it that good looking.

I used this source

http://rgba.scenesp.org/iq/computer/articles/ssao/ssao.htm



Is there a paper describing the implementation you used?



I think SSAO should be a render pass, as the current bloom implementation, so it can be easily switched on and off.

Could you elaborate on that? How would you prefer it to be integrated?

Well, ideally of course there would be some interface for post-processing effects, so you can just drop bloom, motion blur, ssao, shadow pass and it'll all play along nicely. This would work because the Renderer would automatically draw to a high resolution FP FBO, call the postprocess system, downscale for supersampling, then draw to backbuffer.

Yeah it's very similar to that article. Got most of the hints from this thread, started by the author of it: http://www.gamedev.net/community/forums/topic.asp?topic_id=463075



Biggest diff from that source is that i'm reflecting the sample vectors if they are not in the hemisphere given by a pixels normal, to make sure we are only testing in front of the pixel. The other thing is using a noise texture to remove the banding artifacts coming from the low number of samples. The noise texture is used to get some randomization to the sample vectors.



What i'm trying to do now is render it at a lower resolution and bring it back up through bilateral upsampling… if i can pull that off s



Momoko: Yeah i agree we need a post-processing system

If you need some more help, check out this topic, it has a GLSL shader ready to be used:

@vear  - that shader is more an outlining shader than a SSAO shader in my eyes. Isn't it only comparing the depths to get an "ambient value" ?  :?



@Momoko_Fan  - You mean something like deferred rendering? or just for the special effects?

Haladria said:

@vear  - that shader is more an outlining shader than a SSAO shader in my eyes. Isn't it only comparing the depths to get an "ambient value" ?  :?



I think its comparing the depth values to get the normal. It works, tho i'm sure a better one can be made.

I've seen that guy on other forums and he just doesnt get it…what he is posting is an equivalent of an outline/sobel shader, so you will only get darkening where the z differs, which sucks. it "works" as an outline tracer though :wink:

Looks awesome MrCoder - one question though: What kind of Shader level does it require? I thought of making something similar at one point from an chapter in SHaderX3 about Parallax Occlusion Mapping only to realize that very few people would be able to use it due to the reqs.



Oh and are you gonna be releasing the source code?  :slight_smile: