RfM
Baking 2D Textures


return to main index




Introduction

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 specific to a single object, for example,
    C:/Users/jdoe/Documents/torii._MAPID_.exr

Or the path can be specified in a way that automatically takes into account the names of different objects. For example, this text if copied into the "Filename" text field,
    ${RMSPROJ}/renderman/${OBJPATH}._MAPID_.exr

it will automatically output the a file path for every object to be baked. Text fields are "pre-processed" by a TCL interpretor that is part of RfM. For more information about the use of TCL variables and expressions refer to the Pixar doc, Tcl Scripting



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.