AmbientOcclusion

From Odwiki

Jump to: navigation, search

AmbientOcclusion is the measure of what how much a point is occluded from all directions in the hemisphere above the point.

AmbientOcclusion assumes no directional light; light approaches evenly from all directions.

Picture a fisheye camera at every point on the surface of an object. If you look at one the images that one of those cameras takes, you may see some objects or part of your own object. Those objects would be shadowing this point partially if the light was coming from all directions. If you summed up all the points in the picture that are occluded and all those that aren't and divided those numbers, you'd get a single value representing exactly how occluded this point is. (The percentage of occlusion)

mantra computes AmbientOcclusion automatically for you if you use the occlusion() VEX call. It does this by firing off rays in the hemisphere above the point and averaging the hits and the misses. It uses the fastest form of RayTracing because it doesn't care what the other surface looks like (as it does when computing Full Irradiance). This process is really fast, but can slow down on heavy or displaced geometry.

Tips for using AmbientOcclusion

  • Because AmbientOcclusion can be a fairly lengthy render process, you can ShaderUnwrap the AmbientOcclusion, allowing you to apply it later like a TextureMap. Read the Tips in the ShaderUnwrap page for some advice.
  • If you're in an interior scene (like in a room of a house) and want to compute nice ambient shadows in the nooks and crannies, you can tell mantra to send "shorter" rays.. i.e. don't send rays off to infinity - pretend that that is a kind of ambient light source in the room. In a real-life scaled set, set your ray length to be 3-5 meters and you should get a good result. You can do this in the shipped shader called VEXGlobalIlluminationSHOP.
© 2009 od[force].net | advertise