POV-Ray : Newsgroups : povray.binaries.images : Ambient occlusion experiment : Ambient occlusion experiment Server Time
2 Aug 2024 14:19:18 EDT (-0400)
  Ambient occlusion experiment  
From: Tom York
Date: 30 Jun 2007 20:35:01
Message: <web.4686f67c67be5d23cd9678ee0@news.povray.org>
I implemented a basic sort of ambient occlusion using the MegaPOV 1.2.1
source as a base. The idea behind ambient occlusion is outlined here, if
you've not heard of it before:

http://www-viz.tamu.edu/students/bmoyer/617/ambocc/

The example on that page pretty much sums up my use case: a shader that will
produce an occlusion image that I can layer over a direct illumination pass
to suggest more realistic shading. There are alternative ways in povray to
get the ambient occlusion effect, and alternative ways to fulfill the use
case as well, but I liked the simplicity of the ambient occlusion idea, and
after experimenting with a method based on the proximity pattern I decided
that source modification was probably the cleanest and fastest route to go.

At the moment the effect samples entire hemispheres (I thieved the
hemispherical sample set that standard radiosity uses, I'm afraid), so you
need a lot of samples to reduce the noise. Because the sampling surface is
so extensive, objects also react quite strongly to each other and the
occlusion effect is very visible. Narrowing the sampling surface would
concentrate the effect (and require fewer samples to reach the same noise
level). I've heard (here?) that altering the sampling surface can alter the
perception of scale the effect produces.

The attached image shows a simple scene using 128 AO samples, consisting of
a sphere and a few cylinders, with some cylinders CSG differenced. It took
22 minutes to render on a laptop with a Pentium 4-M 1.8GHz processor,
although I was listening to banging tunes and using the information
superhighway at the same time. It was rendered with antialiasing settings:
A0.3 and AM2. I hope it isn't too unbalanced, brightness-wise, as this
laptop's screen is absolutely horrible.

This is quite a simple scene and the method can be expected to slow down
considerably as scene complexity increases. Having said that, it's not as
slow as I thought it might be despite the number of samples I'm using.
After introducing the ability to change the size of the sampling
hemisphere, which should allow me to reduce the number of samples used, I
plan to think about the best way to integrate this into POV's materials
system. At the moment it basically acts the same way as the finish term
ambient does. Also, full occlusion is always black and zero occlusion is
always white, whereas most apps allow the user to choose.


Post a reply to this message


Attachments:
Download 'ambientocclusiondemo.jpg' (59 KB)

Preview of image 'ambientocclusiondemo.jpg'
ambientocclusiondemo.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.