AOBake v0.2Ok, so I lied. My next script ended up being impractical again. Welcome to
AOBake, a raytraced Ambient Occlusion texture baking script for Anim8or.
DescriptionTo use this, select mesh shapes or faces in a mesh shape that you want to bake the AO for. Alternatively you can select nothing and it'll bake AO for all shapes in the object. This script writes all of the selection onto one texture, so be wary of overlapping UVs from different objects.
Go to Build->Export, and select the "Bake AO to PPM Image" (.ppm) file format and save to the file name of your choice. Anim8or will then generate the AO. You can track the progress in the console.
The .ppm format can be opened in image editors such as GIMP and Photoshop
Attribute Options:AO_Width: (int [Default 128]) Sets the width of the texture in pixels (Default 128). Increasing this value slows render time greatly.
AO_Height: (int [Default 128]) Sets the height of the texture in pixels (Default 128). Increasing this value slows render time greatly.
AO_Samples: (int [Default 3]) Number of rays cast per pixel on a triangle (Default
. Increasing this value slows render time.
AO_Blending: (int [Default 0]) "Blurs" the results so that it's less pixellated (Default 0). The number represents the number of blur iterations. 0 means no blur. If you have very low samples, you'll want high (10-20+) blur. You can achieve this effect in an image editor, though the blending here automatically crops it to the uv cluster space.
AO_Padding: (int [Default 3]) Number of pixels that will be padded around each UV cluster (Default 3)
AO_Contrast: (float [Default 0]) Adds contrast so that lights are lighter (Default 0). 0 is no contrast, 0.5 is moderate, 1.0 is high, 1.5 is extreme, etc. Can also be done in an image editor.
AO_RayLength: (float [Default Variable]) Anything past this distance (in Anim8or Units) will not be detected as occluding the light. Useful if you want to have more or less geometry affecting the shadowing. If not set, the ray length is automatically set to 0.15*(diameter of bounding sphere)
AO_BGColor: (point3 [Default 255 255 255]) Background color of the image. Useful if you want to do your own blur or image editing.
AO_RayConeBounds: (float [Default 0.15]) Determines how close to the plane of the triangle a ray can go (example in image below). Clamped between 0 and 0.999
Ray Cone Bounds Effect To-Do- Optimize...where's my octrees?
Sample ImagesNot much yet (yeah, it's that slow).
Warning: Best to treat this script as experimental. This script is very slow and practically primeval (hah...ahah...). If you want fast, high resolution AO, turn to something like xNormal. Otherwise tinker as you will