Tutorial Ambient Occlusion:

a GI fake, can be used for image based lighting.

The idea behind ambient occlusion is to get the effect of soft shadows without the need for area lights or global illumniation. It is a radiosity fake. One of its best uses would be as a layer in compositing. etc

  1. Install the plugin:
    1. Copy cgShaders.dlt to your ..\3dsmax6\plugins directory
    2. Copy cgShaders.mi to your 3dsmax6\mentalray\include directory
    3. Restart 3dsmax
  2. Create Ambient Occlusion shadow pass:
    1. create a sample scene or use sample.max
    2. Set Renderer to Mental Ray
    3. Create Standard Material named "Ambient Occlusion"
    4. Set material to 100% self illuminated, lock ambient and diffuse and specular
    5. In ambient map channel add a Normal Occulsion Maps and Apply Material to all geometry
    6. Render with mental ray

      Note the material is darker where a ray passing out froma given pixel collides with another face of geometry. This is how ambient occlusion works, A ray is occluded if it collides with another piece of geometry, for each pixel a number of rays are sent out and the amount of "Dirt(Shadow)" colour that is mixed into the map is determined by the number of rays that are occluded. THese are the parameters for the Ambient Occlusion Normal Map Material:

    7. Base: 0% Ocluded (White default)
      Dirt: 100% Ocluded (Black Default)
      Probe Geometry: this check box makes sure the rays are checkign for intersection with geometry, which gives the shawdowed look
      Probe Environment: Allows the Environment to be included with
      Invisible to Secondary illumination: this is added so that the Normal Occlusion Map can be used in conjuction with Final Gather
      Ray Spread: Determines the angle of the cone over which the rays are cast
      Samples: Determines the number of Ray the NOM uses
      Near Gain: is the minimum Distance it which a Ray can be occluded
      Far Gain: Is the maximum distance a Ray will travel to be occluded
      Falloff Gain: Is used to control the contrast of the material from perpendicular to paralell
      Gain: Together the Near and Far Gain control the scale of the scene and the accuracy of the occlustion.
    8. Increase samples to 50 and Ray Spread to 80.0 to get rid of any grain
  3. Add an environment:

    With default settings the NOM only takes into consideration occluded and not occluded it doesnt take into consideration that light may only come from one direction. By Adding an environment we can make a simple dome light

    1. Open the Environment and effect channel
    2. copy this as an instance to the material editor, with he following settings, V rotation 90 this represents light at the top of the scene
    3. render the scene like this
    4. Experiment by Adding a reflection map used in your scene or HDR sphere to create coloured shadows, use a heavy blur or pre convulte in HDR shop
  4. Create a scene with predominately overhead ambient light
    1. create materials for the scene, using scan line renderer
    2. Add a skylight
    3. add specular omnis or use maps and raytraced material
    4. render without shadows
  5. Add Softlights via multiply
    1. make two layers in photoshop, or compositing package
    2. with the ambient occluscion layer over the top
    3. set transfer method to multiply
http://www.cgcharacter.com/shareware