Occlusion Baking Demo
=====================

  Illustrates how to use the new mesh_camera feature to bake an occlusion map
for a mesh object. The mesh needs to be UV-mapped.

Contents:
---------

+ baked_maps_demo.pov

  Demo scene to test the baked occlusion maps. Contains a helper macro which 
eases the use of the occlusion maps as a pattern for a texture map.

+ bake_occlusion_map.pov

  This is the scene which bakes the occlusion map with a tricky area_light
setup.

+ demo-textures.inc

  Some textures for the demo scene.

+ dragon_POV_geom.inc

  Test mesh object, converted from the dragon model at the The Stanford 3D 
  Scanning Repository: http://graphics.stanford.edu/data/3Dscanrep/

+ repair_seams.pov

  Helper scene to mitigate the visible seams of the uv islands on uv maps.

+ sm_jvp_office.jpg

  An spherical image to liven up the reflections on the demo scene.
  
Usage:
------

  Get your uv-mapped mesh and convert it to POV-Ray format, or use the one
included for tests.

  Edit the bake_occlusion_map.pov and change the include file for the mesh 
geometry, and the name of the mesh both on the mesh object instance, and on 
the camera sentence. Or leave it as it is, to render the test object.

  Render bake_occlusion_map.pov with a square ratio, using an appropiate 
ouput name. For the included demo object, just use:
                                                   
  +w1024 +h1024 +FN +UA +odragon_occlusion_map.png 
  
  To correct the visible-seams problem later when using the map back into 
the mesh, edit the repair_seams.pov scene and change the name of the map to
repair. For the included test object, leave it as it is, and render with:

  +w1024 +h1024 +a +FN +UA +odragon_occlusion_map_repaired.png 
  
  Now, to get a smooth map, use The Gimp, or your preferred app, and apply a
bit of blur to the repaired map (gaussian 2x2 works for me on the Gimp), then
save it with another name (dragon_occlusion_map_blur.png for the included
demo scene).

  Finally, you can use the blurred map back into your mesh using a texture_map
to mix two textures, one for the occluded parts, and another for the exposed 
parts. See the bake_occlusion_map.pov scene for an example on how to set it up
(to have a quick glance at how it looks, just render the scene, which will use 
the included dragon mesh and its corresponding occlusion map, also included on
the zip).

  As usual, any comments, questions or suggestions are welcome...

--
Jaime Vives Piqueres <jaime@ignorancia.org>

