Title: screen space ambient occlusion Post by: Tglad on March 29, 2010, 03:24:03 AM Hi, I'm wondering whether any of the fractal renderers use screen space ambient occlusion? http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion (http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion)
It seems like a good way to add more depth to the image without resorting to the cost of global illumination. I know the wip3d for UF has an ambient occlusion option but it doesn't really work on the Mandelbox so I wonder whether other packages use or have considered using this screen-space technique? Title: Re: screen space ambient occlusion Post by: David Makin on March 29, 2010, 01:51:57 PM At some point I also thought that the orbit trap based ambient occlusion didn't work for the Mandelbox but I was actually mistaken.
The thing I overlooked was the *size* of the Mandelbox - because of this the max and min settings for the orbit traps both need to be increased. In my formula for UF you can get the correct values for the min and max occlusion values as follows: 1. Switch colouring to "Lighting+Colour". 2. Set the colour to be used to white. 3. Set the lighting method to "Camera". 4. Set the light strength to 1.0. 5. Set the diffuse and specular strengths to 0.0 6. Make sure ambient occlusion is enabled and set the base ambient to 1.0 (leave sourced ambient at zero). 7. Now adjust the min and max values for the orbit trap occlusion - for most Mandelboxes this means increase the values from the defaults. If anyone has trouble getting it set correctly reply here and I'll post an example UPR tonight (am at work now). Title: Re: screen space ambient occlusion Post by: chaospro on March 29, 2010, 08:37:16 PM Hi,
Hi, I'm wondering whether any of the fractal renderers use screen space ambient occlusion? http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion (http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion) It seems like a good way to add more depth to the image without resorting to the cost of global illumination. I know the wip3d for UF has an ambient occlusion option but it doesn't really work on the Mandelbox so I wonder whether other packages use or have considered using this screen-space technique? ChaosPro also has screen space ambient occlusion built in. And yes, it adds a much more realistic lighting than the "normal" lighting algorithm. The algorithm used by ChaosPro should not depend on other settings, as it adjusts automatically and works on the image visible on the screen (basically only uses the z-buffer, thus "screen space"). The algorithm implemented in ChaosPro is this one: http://www.malmer.nu/index.php/2008-04-09_ssao-c-style-pseudo-source-code/ Kind regards, Martin Title: Re: screen space ambient occlusion Post by: David Makin on March 29, 2010, 11:03:44 PM It is possible to do screen-space ambient occlusion in UF, the only problem is that it requires a z-buffer and that's problematic in UF, the rendering would have to be done in the global section with a pseudo-screen buffer as well as the z-buffer (unless the calculations where performed twice), this would be OK for resolutions up to say around 3000 pixels square but until everyone has 64-bit systems and UF is fully 64-bit enabled we'd not be able to render print quality sizes (though it'd be fine for most animations).
Title: Re: screen space ambient occlusion Post by: Tglad on March 30, 2010, 01:01:59 AM Awesome, so Chaospro does it, UF does a different form of ambient occlusion, but could potentially do it. I think mandelbulb3d does something like it.
David, I'll try out the method you say for getting the values right. Title: Re: screen space ambient occlusion Post by: Isokron on March 31, 2010, 12:51:16 PM I use ssao in to add some depth cues in my realtime viewer and it gives nice results if you dont overuse it (try turning on/off postfx to see difference). Orbit traps probably gives better results though but only works with outside views (although I guess the inverse could work from inside, haven't tried).
Title: Re: screen space ambient occlusion Post by: Buddhi on April 02, 2010, 01:54:43 PM Your posts inspired me to implementation of screen space ambient occlusion to my program. I didn't used original algorithm with random samples but I developed my own algorithm. I will describe how it works when I optimise it. Now it is not so fast but results are interesting. Please look at attached image (image was shaded using only this algorithm)
Title: Re: screen space ambient occlusion Post by: ker2x on August 07, 2010, 09:54:27 PM I'm working on my own mandelbulb rendering (yay!), can you tell me more (with simple words) about your SSAO please ?
My last try is an (interesting) big FAIL! :) (http://fractals.s3.amazonaws.com/mandelbulb/Mandelbulb-ambiant-oclusion-fail.jpg) Title: Re: screen space ambient occlusion Post by: knighty on August 08, 2010, 12:56:42 AM It looks better if you invert it:
(http://www.fractalforums.com/gallery/3/932_08_08_10_12_54_16.jpeg) Title: Re: screen space ambient occlusion Post by: Buddhi on August 08, 2010, 10:01:11 AM I'm working on my own mandelbulb rendering (yay!), can you tell me more (with simple words) about your SSAO please ? My last try is an (interesting) big FAIL! :) After inverting it looks much more better. However I will try to explain how my SSAO algorithm works. On the first attached image there is cross-section of the fractal and example rays for one scanning direction. Red line is the z-buffer. On the second image there is view from front (from camera) and scanning directions. For each scanning direction the algorithm finds minimum angle between camera vector and vectors created by actually calculated point (centre) and scanned point. If the angle is lower it means that in this direction there is less light. Program remembers this "light" intensity as proportional to minimum angle. Of course for this operation each screen coordinate has to be transformed to fractal coordinates. The same operation must be repeated for each scanning direction. Resultant ambient light intensity is a sum of light intensity for all scanning directions. For faster calculation of SSAO I have used higher scanning resolution near actual centre point and much lower for far distances (like on second image). Optimal maximum scanning distance is half image width. It gives high detail level and realistic result. If you want to look at implementation in c++ please download Mandelbulber and find source file image.cpp and function ThreadSSAO(void *ptr) Third image shows how it looks on whole Mandelbulb. There was used only SSAO for shading. If something is not clear please ask. Title: Re: screen space ambient occlusion Post by: ker2x on August 08, 2010, 12:41:18 PM thank you very much. with the explanation and the code, i should be able to recode your implementation :)
I'm currently rewriting a XNA HLSL implementation with the help of code found here and there, to understand every bit of the mandelbulb, then i'll code an openCL version :) Title: Re: screen space ambient occlusion Post by: Rrrola on August 08, 2010, 01:23:38 PM Boxplorer's fake ambient occlusion is computed from distance estimation samples taken along the normal (doesn't need a z-buffer, only 5 extra distance computations per pixel): Parameter α controls strength and δ controls the scale of details that will be affected by AO. The technique is explained in http://www.iquilezles.org/www/material/nvscene2008/rwwtt.pdf (http://www.iquilezles.org/www/material/nvscene2008/rwwtt.pdf), pages 47–54. |