For the iOS app I am writing I want to incorporate some aspects of ambient occlusion for photo manipulation. Can someone suggest a GLSL approach that will work. Realtime performance is not super critical. Under a second compute time is fine.
-
\$\begingroup\$ Just googled Ambient Occlusion, this seems pretty detailed: http.developer.nvidia.com/GPUGems2/gpugems2_chapter14.html \$\endgroup\$– ashes999Commented Apr 23, 2012 at 13:34
-
\$\begingroup\$ No worries, hope it helps. I don't know about your specific problem, but that sure helped me understand what you're asking :) \$\endgroup\$– ashes999Commented Apr 23, 2012 at 14:45
1 Answer
Generally, ambient occlusion requires 3D data to be calculated. If you are planning to add some depth information then I would suggest the use of screen space ambient occlusion; SSAO.
Using screen space ambient occlusion should fit better into your pipeline. Since you want to manipulate photos, I presume you already have a method for adding post process filters.
What you will need to do is render the 3D data to a depth buffer. There are many sources which detail how to do this. If you can't find any, try looking up deferred shading techniques. These rely on filling a depth buffer for post processing so there should be a good example out there for you.
-
\$\begingroup\$ One of the approaches I have in mind is to break a photo into pieces - squares, dots, shards - displace them in z and then do an AO bake and shade. Also, tearing a photo into pieces then overlaying multiple instances of the same photo then AO bake and render. I need AO to help "sell" the overlay and sence of depth. Cheers. \$\endgroup\$– duglaCommented Apr 23, 2012 at 14:10
-
\$\begingroup\$ In my system an iPad/iPhone photo is converted to a texture-mapped quad so everything is 3D. I use a 3D viewing frustrum to enable z-depth. \$\endgroup\$– duglaCommented Apr 23, 2012 at 17:53