Baking 2D Textures

return to main index


Version 21 of RfM introduced a very convenient PxrBakeTexture node that enables a procedural pattern to be baked as a texture map. For example the pattern shown in figure 1 was baked as the map shown in figure 2.

Figure 1

Figure 2 - baked texture map

The shading network shows the PxrBakeTexture node wired between the PxrOSL node that produces the procedural pattern and "Diffuse Color" input of PxrSurface.

Figure 3

Basic Setup

Once the PxrBakeTexture node has been wired between the node that generates a pattern and the Bxdf, say PxrSurface.DiffuseColor, set a path to the texture to be baked.

Figure 4

The path can be explicit, for example,
Or, it can be specified using variables whose values will be substituted by a TCL interpretor,
For example, the expression shown above uses two variables that are defined by RfM,
    RMSPROJ (example: "C:/Users/jdoe/Documents/maya/projects/foo")
    OBJPATH (example: "pCube2")
Consequently, the path specified by the expression might be,


Preview Workflow

Set the Render Mode to "Input".

Figure 5

Render the scene in the normal way to confirm the pattern is still "working".

Baking Workflow

Set the Render Mode to "Texture".

Figure 6

Render the scene using Bake Render".

Figure 7

Once a "good" bake has been achieved reset the Render Mode to "Automatic". Subsequent renders will ignore the shading network and, instead, use the pre-baked texture.

© 2002- Malcolm Kesson. All rights reserved.