nicer and faster SSAO

The latest one works beautifully on my ATI, except for it brings the frame rate on my computer from 30 fps to 15 fps.

I assume there is no realtime raytracer in blender GE ?

No way! Such things are still experimental at the moment. BGE uses strictly OpenGL/GLSL shading, you need OpenCL to raytrace in real time. OpenCL is not widely supported yet.

The reason, is because OpenGL is designed to shade models in real time, nothing else. It isn’t built to handle raytracing, and I doubt you can add that kind of functionality to it. OpenCL, however, is more openended. You can program a raytracer with that, and it will positively SCREAM. (very fast)

Hope this helps,

MTracer.

I’m not sure that’s strictly true - not true raytracing, but you can do shader-based raytracing using pixel shaders, it’s one of the standard approaches for volumetric shaders and plenty of other things. I’ve seen a simple but complete raytracer implemented in a GLSL pixel shader before, so it should be quite possible in BGE. Not sure why you’d want to it though…

The luminance texture causes a huge performance drop on my ATI 3850 card. It’s 120 without SSAO and 11 with SSAO on. Can you please tell me what that “Luminance Texture” is ?

It takes the light areas of the screen and add it to the ssao layer, this makes the ssao to not shade light sources as windows.

I got no mouse look…But it is inside and “online” in logic bricks…

@Cloud_GL: I’ve figured out a way to fix the performance drop:

just change the
“vec3 color = texture2D(bgl_RenderedTexture,texCoord).rgb;
vec3 luminance = texture2D(bgl_LuminanceTexture,texCoord).rgb;”

to
“vec3 color = texture2D(bgl_RenderedTexture,texCoord).rgb;
float avg = (color.r+color.g+color.b)/3;
vec3 luminance = vec3(avg,avg,avg);”

in all three scripts. It works flawlessly on my ATI now. :smiley:

Qv51, you are totally right, there is no performance drop now. Thanks

you are not using any kind of normal map in this version? (not even generated from Depth map ?!)

nope this one uses only depth buffer.

and the proper way to get luminance from color would be:


vec3 lumcoeff = vec3(0.299,0.587,0.114);
vec4 color = texture2D(bgl_RenderedTexture,gl_TexCoord[0]);
float lum = dot(color.rgb, lumcoeff);
vec3 luminance = vec3(lum, lum, lum);

So… I’ve given this some thought… and this is just that, a thought

My opinion based on observation is that ambient occlusion happens everywhere - lit areas have it as well, I think its just more subtle based on the adjustments the eye needs to make - so I think your HDR work over this would sort of wash it out - maybe.

Is it possible to add colour some how to the mix? By making the resultant ambient occlusion use a contrasting colour shade of the colour being occluded? I think it would look even more realistic.

I know it’s pretty common to apply black in a multiply type blend over the image, but in reality, I think its not really black.

Does anyone follow that? :slight_smile:

Yeah. It’s already been done. Search the forum for “screen space gi”.

Suuuuwweeet.

in case we could add a normal map, would it be possible to compute color bleeding as well with it ?
I did check your post about color bleed shader you did, but the blend file is not available anymore, so I don’t see how it works, but I believe you need a normal map for that.

The test scene works for me, but when I try to apply it to my own scene, I don’t get any occlusion at all. Why is that? :confused:

http://www.pasteall.org/pic/show.php?id=3641

Did you append the ‘effects’ object to your scene? That worked for my .blends.

If that doesn’t work play with some of the values in the script, it could be you need to set it so it works at higher light levels.

Appending the effects object doesn’t work because it doesn’t append the text files.
And I don’t really know what values to mess with in the script.

Anyone who can convert DirectX code to the OpenGL equivalent may like this article
http://www.gamedev.net/reference/programming/features/simpleSSAO/

Padfoot7726: The appending of text files with the effects object should work if you convert it to an internal text file instead of an external one if it is external.

REP!! I get 800+ FPS in ur scene, then 790 with SSAO !! 10FPS drop!! SOOO SMOOTH
Awesome!

(running ATI HD5870, intel i7 960, 12gb ddr3 1600mhz ram)