On this page | |
Since | 20.5 |
Overview ¶
The Karma Texture Baker LOP creates USD render var
, render product
and render settings
primitives to set up texture baking for a single object. This node writes to the USD stage and configures rendering for Karma. You can then write the stage to disk or further modify it with LOP nodes.
Note
Baking currently only works for objects with a MtlX Standard Surface VOP shader.
Parameters ¶
Rendersettings Primitive Path
Scene graph path to the RenderSettings
prim to render with. If this is blank, the node looks for default render settings on the root prim. If the root prim has no render settings, the node will use default settings.
Baking Mode
Specifies how the shading point is determined for each point on the bake mesh.
-
Trace. This mode sends rays from the low res mesh in the direction of the surface normal to find the shading point. This method works if multiple objects are baked onto a single mesh. The other scene objects don’t need UV coordinates.
-
UV Match. This method takes a single high-res mesh and determines the shading point by matching UV coordinates from the low-res mesh. UV Match makes sense if the high-res mesh doesn’t align very well to the low res mesh.
Bake Mesh
This is the mesh that will be baked. The polygons are rasterized based on the mesh’s UV coordinates.
Cage Mesh
This parameter is only available when you set Baking Mode to Trace. Sometimes it’s problematic to determine the direction to trace rays from the bake mesh to the scene. When you specify a cage mesh, rays are sent from the position on the cage mesh through the matching position on the bake mesh. This leads to finer control when determining the shading position.
High Res Mesh
This parameter is only available when you set Baking Mode to UV Mesh and specifies the high-res mesh that has matching UV coordinates. The position data of this mesh are used to compute the shading information.
Dicing Camera
Specifies the camera that’s used for dicing subdivision or displaced surfaces. This parameter is mandatory for the texture baker to work correctly.
Output Picture
The filename of the output image. When you bake a single image, the node uses the name exactly as entered here.
However, when you render separate images for each AOV, this name will be the starting point for the individual AOV filename. The AOV name will be appended to the Output Picture just before the file extension. The file extension will be changed to the format that you've chosen from the Image Format dropdown on the Images tab.
Resolution
The horizontal and vertical size of the output image, in pixels.
UDIM
When baking, Karma will render the images for a single UDIM tile. The parameter specifies which UDIM tile will be rendered.
Images ¶
Create Separate Files
Renders either a single image with multiple AOVS, or store each AOV in a separate file.
Tip
To see all AOVs, render a single image to MPlay.
Image Format
Specifies the format the image format of the separately rendered AOV. The file extension will change accordingly.
Name Separator
This character will be used to separate the file name from the Output Picture parameter and the AOV channel name. For example, when you bake Nt
and P
AOVs and Output Picture is render/bake.png
, the output file names will be render/bake_Nt.png
and render/bake_P.png
.
Note
You can inspect the stage and see details for all the render products in the created render settings primitive.
Expand UV Islands
Post-processes the images by smearing the boundaries of the UV islands into the empty areas of the image. This will produce better results when MIP-mapping the textures. This process can be time-consuming. For faster iterations, only turn on this feature for the final baking.
This tab specifies AOVs that are defined as outputs of the shading state.
Tangent Space Normal (Nt)
Creates an AOV for the tangent space normal. You can change the AOV’s default Nt
name.
Displacement (Ds)
Displacement between the bake mesh and the shading point as a scalar value. You can change the AOV’s default Ds
name.
Vector Displacement (Vd)
Displacement between the bake mesh and the shading point as a vector value. You can change the AOV’s default Vd
name.
Tangent-Space Vector Displacement (Vdt)
Displacement between the bake mesh and the shading point as a tangent-space vector value. You can change the AOV’s default Vdt
name.
Occlusion (Oc)
Ambient occlusion. You can change the AOV’s default Oc
name.
Cavity (Cv)
The occlusion along the inverted normal at the shading position. This produces “relief” shading. You can change the AOV’s default Cv
name.
Thickness (Th)
The thickness at the shading position. You can change the AOV’s default Th
name.
Curvature (Cu)
The curvature at the shading position. You can change the AOV’s default Cu
name.
Alpha (Af)
The alpha at the shading position. You can change the AOV’s default Af
name.
Shading Position (P)
The shading position. You can change the AOV’s default P
name.
Shading Space
When you store the P
AOV, this is how the position should be represented
-
World Space. The shading position is written directly to the AOV.
-
Bake Mesh Bounding Box. The shading position is fit to the bounding box of the bake mesh.
-
Scene Bounding Box. The shading position is fit to the bounding box of the whole scene.
-
User Defined. The shading position is fit to user specified values.
Shading Normal (N)
The shading normal. You can change the AOV’s default N
name.
Shading Position (Ng)
The geometric shading normal. You can change the AOV’s default Ng
name.
This folder specifies AOVs that are defined by the MtlX Standard Surface shader’s inputs. Currently, you can only use inputs to a single MtlX Standard Surface shader, so blending of shaders is not supported.
Additional AOVs are available for all defined inputs of the MtlX Standard Surface.
Base Combined
The MtlX Standard Surface defines the base color as base * base_color
, where base
is a scalar multiplier on the color given by base_color
. This AOV stores the multiplied result as a single channel.
The Coat Normal, Shading Normal and Shading Tangent values are stored exactly as they are wired into the shader (in world position).
When you bake textures, lighting computations are not always required. However, Karma is capable of baking lighting AOVs.
Enable Lighting
Turns on lighting computations for baking.
Beauty
Stores the beauty image as an AOV with RGBA colors through the LPE C.*[LO]
Combined Diffuse
Stores the direct and indirect diffuse illumination through the LPE C<RD>.*L
.
Direct Diffuse
Stores the direct diffuse illumination through the LPE C<RD>L
.
Indirect Diffuse
Stores the indirect diffuse illumination through the LPE C<RD>.+L
.
Facing Ratio
Stores the facing ratio from the Dicing Camera.
Extra AOVs
Define any custom AOVs here. In addition to lighting AOVs, you can also specify AOVs defined by Primvars or other Karma-specific AOVs.
Baking ¶
This folder contains parameters that control the baking operations.
Make Bake Mesh Invisible
In most cases, the bake mesh should be invisible to any rays. This means that the mesh won’t contribute to occlusion or other ray-traced effects. However, there might be situations where the the bake mesh remains visible.
Bake Traceset
Define the visible traceset of primitives on the bake mesh. You can use tracesets to subdivide a mesh into different parts. For example, the clothing on a character might have tracesets like pants
, shirt
and jacket
. You can then define which part/traceset you want to bake. You can specify tracesets on the object through the Custom Tracesets parameter on the Render Geometry Settings LOP.
-
With the default
*
entry, all tracesets will be visible. -
If the bake mesh has a string primvar named
bake_traceset
, the values in the primvar will override this setting. Note that this traceset also affects secondary rays (occlusion, curvature, etc.) -
You can also define a blank-separated list of different tracesets to combine them, e.g.
pants shirt
.
Primary Samples
Specifies the number of camera rays sent for each pixel. Higher values improve the quality of the rendering.
Trace Bias
When rays are sent from the bake mesh to the scene, this bias is used to offset a ray’s origin from the surface of the bake mesh. You can use this parameter to arbitrarily offset the bake mesh along its normal without having to define a cage mesh.
Use MikkT Tangents
MikkT is a common standard for tangent space used in baking tools to produce normal maps.
Dicing Quality
When baking displaced meshes or subdivision surfaces, this parameter can control the level of detail of the dicing.
True Displacement
Sometimes, displacement shading inverts the surface and produces bad normals. This parameter lets you run displacement shaders as bump map shaders. Alternatively, you can disable displacement shading entirely.
Occlusion Samples
Determines the number of indirect rays used when computing Occlusion. If the resulting AOV is noisy, you can increase Occlusion Samples without having to increase the Primary Samples.
Occlusion Max Distance
The maximum distance to consider when computing Occlusion. A small distance can speed up occlusion shading at the cost of accuracy.
Occlusion Ray Bias
Controls the ray bias when computing Occlusion.
Thickness Samples
Determines the number of indirect rays used when computing Thickness. If the resulting AOV is noisy, you can increase Thickness Samples without having to increase the Primary Samples.
Cavity Samples
Determines the number of indirect rays used when computing Cavity. If the resulting AOV is noisy, you can increase Cavity Samples without having to increase the Primary Samples.
Curvature Samples
Determines the number of indirect rays used when computing Curvature. If the resulting AOV is noisy, you can increase Curvature Samples without having to increase the Primary Samples.
See also |