Texture Baking
Texture baking is a process where scene lighting is baked into a texture map based on an object's UV texture coordinates. The resulting texture can map back onto the surface to create realistic lighting in a real-time rendering environment. This technique is often used in game engines and virtual reality for creating realistic environments.
OctaneRender®implements texture baking as a special type of camera known as a Baking camera. Compared to the Thin Lens and Panoramic cameras, the Baking camera has one position and direction per sample. OctaneRender calculates these based on the input UV geometry and the actual geometry being baked.
For each sample, the camera calculates the geometry position and normal, then it generates a ray that points towards it using the same direction as the normal from a distance of the configured kernel’s ray epsilon. Once calculated, OctaneRender traces the ray the same way it would do with other types of camera.
Figure 1: Lighting is baked onto a model of a planet using a Baking camera
Mesh Requirements For Baking
To use a Mesh for texture baking, it needs the following:
- The Mesh should contain at least one UV set. Alembic files can contain up to three sets.
- Eliminate any overlapping UVs. Overlapping UVs occur when more than one pmesh or mesh component share the same UV texture coordinates. Otherwise, you may find artifacts due to overlapping geometry.
Figure 2: Overlapping UVs as shown in Maya's UV editor
Setting Up A Texture Baking Camera
For more information on setting up a Baking Camera, refer to the Octane Camera section.
You can use render layers, AOVs, imager settings, etc. in the same fashion as other types of cameras, allowing extracting lighting and material information.
Figure 6: Any of the Octane AOVs can be baked into textures
Baking Tips
- Set your kernel’s Filter size to 1.0 since baking does not need much anti-aliasing.
- Set the Imager response to Linear/Off to disable specific camera response curves. This works correctly if View Transform in Color Management of Blender is set to Raw.