modo bubbble logo

Baking Workflow


Home >> Shade, Light & Render >> Baking Workflow

back next
comment balloon Comments (1) RSS Icon
4.2/5 (1 vote)

'Baking' is the process used to pre-compute texture and lighting information. The result is often used for real-time applications (such a for games) or for exporting models into other software packages with complex shading intact, or simply as a way to eliminate rendering overhead in elaborate scenes. In this way shaders and lighting are computed by the modo rendering engine and baked directly into an image that maps perfectly to an existing UV texture.

Perspective Projection
Hi-Res Geometry

 

Perspective Projection
Lo-Res Geometry

 

Perspective Projection
Lo-Res Baked Result

Depending on what your intended purpose is, there are a couple of methods for baking images. If your intent is to simply merge (flatten) multiple shader tree layers, then all that is needed is an image map added to the shader tree set to the appropriate 'Effect' type before baking. When baking maps such as Displacement and Normal maps, two layers of geometry are necessary, typically one is the high resolution model comprised of all the details of the final model, and a second low resolution model that approximates the shape of the high resolution model that serves as the baking target. The low resolution geometry requires a proper UV map with a unique name (unique from any UV maps assigned to the high res version). Additionally, users will need to make sure the applicable layers are selected in the item list, and that the appropriate UV map is also selected. When Baking to Textures, suitable image maps must be placed and selected in the Shader Tree (Don't worry, it only sounds complicated, each set-up is detailed below). For information regarding adding layers and setting their 'Effect', please reference the 'Shader Tree' page of the documentation. All of the baking commands can be invoked from the menu bar within the 'Render' menu. They are as follows-

Bake to Render Outputs--

The command 'Bake to Render Outputs' gives users the ability to use a UV map from a surface to generate a rendered image that can be applied back to the surface as a texture map. Utilizing the functionality of the Shader Tree's 'Render Outputs', this allows the baking of Ambient Occlusion specific texture maps, Diffuse Coefficient maps, or even baking a Final Color map that fully computes all surfacing and shading of the target item. Once rendered, images can be saved to disc from the Render Display viewport, then imported and applied back to the geometry.
Before baking it is important to select the target item in the 'Items' list or 3D viewport and to additionally select the target UV map in the vertex maps 'Lists' viewport. In the Shader Tree, render baking will use the settings from the 'Render Item' to determine bake quality and Frame Size settings. In a default scene the Render Output is set to 'Final Color', users can LMB+click on the effect type in the 'Effects' column of the Shader Tree and define an alternate render output style. Once the target items are selected, selecting the command "Render > Bake to Render Outputs" will render all active Render Outputs simultaneously.

 

Bake from Object to Render Outputs--

The 'Bake from Object to Render Outputs' command is similar to the 'Bake to Render Outputs' command above, however it allows the additional ability to generate its results using an alternate mesh layer. It is essentially transferring the surfacing from one object to another. In this setup, typically, one layer is a detailed, high resolution mesh and the target baking mesh layer is a lower resolution mesh, approximating the overall shape of the high resolution layer. This is often used in games, where the detailed surfacing from the high-res asset is applied to the low-res assets to give the overall visual impression of higher resolution. Once rendered, images can be saved out from the Render Display viewport, then imported and applied to the target geometry.

Baking from an object requires a background mesh layer (visible in the Items list, but not selected) and a foreground mesh layer (selected and visible). The background layer would typically be the high resolution model layer to extract the geometrical, shading and lighting information from and the foreground layer would be the low resolution model layer with a UV map to apply those baked maps to. In the Shader Tree, render baking will use the settings from the 'Render Item' to determine bake quality and Frame Size settings. With the Foreground and Background layers properly referenced, select the target UV map in the Lists viewport and select the command "Render > Bake from Object to Render Outputs", opening a dialog where the user defines an offset 'Distance' that should encompass all surface differences between the two mesh layers. Pressing 'OK' will render all active Render Outputs simultaneously.

Tip icon

IMPORTANT: When baking from a background object to a foreground object, both object layers must have unique UV map names. Collisions will occur if the default 'Texture' name is present on both layers, causing errors or the bake will not produce any results at all.

 

Bake to Selected Texture--

The command 'Bake to Selected Texture' can be found in the menu bar under 'Render > Bake to Selected Texture', but is is more commonly summoned from the Shader Tree directly using the RMB contextual menu (opened by clicking on the target layer) where it is called "Bake to Texture". This command offers the ability to generate a bitmap texture of one or more Shader Tree texture layers, when all layers share the same 'Effect' type. The common uses for the function are to convert a procedural texture layers to a bitmap for displacement freezing, or to combine complex, multiple Shader Tree layers into a single layer. It can also be used to pre-compute render intensive effects, such as Occlusion, saving render time and eliminating frame to frame variances that may occur.

Baking to Selected Texture will require that users first define a new Image Map layer in the Shader Tree. During this process, the file save location is defined, as well as the Resolution and Bit Depth. For information on creating Image Maps, please reference the Add Images page of the documentation. The position of the layer within the Shader Tree is important as well, because only layers below the target will be evaluated for baking. Once the 'Effect' has been defined for the layer, it will also be necessary to disable the layers visibility (by toggling the eye column) to ensure the target baking layer itself won't get evaluated as part of the bake. Then RMB+clicking on the layer, opening the contextual menu and selecting the command "Bake to Texture". Once generated, the image will need to be saved using the menu bar command 'File > Save Image'.

 

Bake from Object to Selected Texture--

The command "Bake from Object to Selected Texture" can be used to generate two specific types of texture maps using the foreground and background mesh layer functionality described in the "Bake from Object to Render Outputs" section. Specifically, the function is used to generate Displacement and Normal maps. A Displacement map is a grayscale image that represent the difference in position between a low-resolution foreground mesh and a high-resolution background mesh, a Normal map uses color to represent the difference in the surfaces Normal facing direction. Both maps, once generated, can be applied back to the lower resolution geometry to give the impression of much greater resolution.

Baking from Object to Selected Texture first requires a background mesh layer (visible in the Items list, but not selected) and a foreground mesh layer (selected and visible). The background layer would typically be the high resolution model layer to extract the Displacement or Normal information from and the foreground layer would be the representative low resolution model layer with a UV map to apply those baked maps to. In the Shader Tree there also needs to be an appropriate target bitmap texture layer with the proper 'Effect' defined for the intended purpose (either as 'Displacement' or 'Normal') and the target UV Map specified. It will also be necessary to disable the layers visibility (by toggling the eye column) to ensure the target baking layer itself won't get evaluated as part of the bake. Then RMB+clicking on the layer, opening the contextual menu and selecting the command "Bake from Object to Texture" will open a dialog asking users for a 'Distance' value that represent the offset distance away from the limit surface. For both 'Displacement' and 'Normals' maps, the 'Distance' value represents the maximum ray travel amount, positive or negative from the baking surface, and should be set to encompass all surface deviations between the two surfaces. Black regions in the bake represent areas beyond the defined distance and should be increased to eliminate them. Setting the value too high can reduce accuracy and may introduce errors, depending on the geometry. Pressing 'OK' will initiate the bake. Once generated, the image will need to be saved using the menu bar command 'File > Save Image'.

Note: Users must make sure that the Normal Map layer in the Shader Tree is not in the same mask as the item you are trying to bake from.

Tip icon

TIP: Depending on the type of geometry, and the resolution of the baked image, UV border seams may be visible. These can be eliminated by the using the 'Bake UV Border Size' option of the Preferences (menu bar 'System > Preferences', listed under Display > Rendering section). In order to take advantage of this functionality, users must have an active 'Alpha' Render Output as well, as modo uses the information of the alpha to compute the border offset.

 

Bake Geometry Cache--

modo has multiple features that work by way of virtual geometry, meaning that the geometry in the scene that the user interacts with isn't the real geometry that is used to render, such as Subdivision Surface models, Displacement, Render Curves, Fur and so on. When pressing 'F9' modo takes the instructions for each feature and converts them to real geometry for the final rendering. This procedurally generated geometry for rendering can be baked into real Mesh items in a scene, making it possible to apply complex procedural displacements or generate fur and bring it back to the scene as real geometry that can be directly edited or exported to other packages. The command is found in the menu bar under "Render > Bake Geometry Cache", selecting the command opens this dialog-

Bake Geo Cache

Surfaces: The 'Surfaces' toggle, when enabled will clone the surface settings of the original object into new Material Groups assigned to the baked geometry.

Shaders: The 'Shaders' toggle when enabled will clone the Shader settings per item of the original object adding it to a Material Group assigned to the baked geometry.

Fur: The 'Fur' toggle, when enabled will convert any Fur in the scene to geometry. If the Fur is set to 'Strips', it will be converted to polygons. If the fur is set to 'Tubes' it will be converted to individual Curves, representing each individual fiber. (Note that the Curves for Fur can be further converted to polygons using the 'Render Curves' command and invoking a second pass of the Bake command)

Running the command converts all Mesh Item layers in the scene, as well as Instances and the procedural effects Fur, Render Curves, and Replicators. Mesh Density is based on the settings for each individual item (exactly as it would tessellate for rendering). The resulting meshes will be a separate Mesh layer for each surface or effect in the scene. Note that special procedural effects, such as Volumes, Blobs. Render Booleans or Sprites cannot be converted to meshes.

Tip icon

TIP: Depending on the complexity of the scene, it is possible to create scenes of immense size using the 'Bake Geometry Cache' command, the render statistics panel gives a readout of the total scene geometry during each render as a useful guideline. Users wishing to modify only single elements can do so by saving individual Mesh layers out by RMB+clicking on the layer in the Items list and selecting the 'Save Selected' command, and then opening the resulting file and applying the 'Bake Geometry Cache' command.

 

comment balloon Comments (1) RSS Icon

bvz September 25, 2013 at 12:01 PM

Don't know if this will help anyone, but when baking to selected texture, I couldn't get the selected object to be the only one to bake (even though I was "inside" a material group that was only affecting those tagged objects). Every item in the scene was being included in the bake.

The problem, as it turns out, was that since my various items were imported from Maya via Alembic, all of them (which have overlapping UV's) had their UV textures named the same (i.e. they were all named "Texture"). As a result, when baking the texture for the first item, the texture from every item which shared the same UV name was included as well. Once I gave each item a unique UV name, baking worked as advertised. This may be obvious to more savvy Modo users, but since I haven't spent a lot of time learning Modo's UV system it took a bit of sleuthing (ok, simply searching the forums) to figure it out. Hope this helps!

Top

back next