On this page | |
Since | 20.5 |
Overview ¶
The Karma Texture Baker LOP creates USD render var
, render product
and rendersettings
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.
When the bake mesh has multiple UDIM tiles, the texture baker will create one rendersettings
primitive for each tile. The bake mesh is typically a poly-reduced version of the high-res mesh that contains the surface details. The bake mesh is hence also called low-res mesh.
Note
If possible, some baking calculations, for example ao
, cavity
or curvature
use the GPU. This process can cause a slight delay when you render the view. Once all data is available on the GPU, the workflow should be smooth.
Tip
In the Solaris section of the Houdini documentation, you can find a workflow guide with detailed information on how to use the Karma Texture Baker page.
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 low-res mesh. The low_res mesh is the mesh you’ll be baking.
-
Trace. This mode sends rays from the low-res/bake 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.
-
Single Mesh. To bake a single mesh, use the same mesh for Low Res Mesh and High Res Mesh.
Low Res Mesh
This is the mesh you're going to bake. 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 low-res mesh to the scene. When you specify a cage mesh, rays are sent from the position on the cage mesh through the topology matching position on the low-res mesh. This leads to finer control when determining the shading position. Note that low-res mesh and cage mesh must have the same topology. Furthermore, the cage mesh must enclose the high-res mesh completely.
High Res Mesh
When you set Baking Mode to Trace, normally Karma will bake all visible surfaces. This allows convenient baking of complicated terrain with instanced boulders. However, this parameter lets you select the objects which will be baked to the low-res mesh.
When you set Baking Mode to UV Mesh, this specifies the high-res mesh that has matching UV coordinates to the low.res mesh. The position data of this mesh are used to compute the shading information.
When you set Baking Mode to Single Mesh, this specifies the high-res mesh. To bake a single mesh, use the same mesh for Low Res Mesh and High Res Mesh.
Dicing Camera
Specifies the camera for dicing subdivision or displaced surfaces. If no camera exists on the stage, the texture baker will create an automatic dicing camera.
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.
UV Attribute
Specify the primvar name of the texture coordinate used for baking.
Default UDIM
When there are multiple UDIMs detected, the texture baker will create multiple USD rendersettings
primitives - one for each UDIM (karmabake_<UDIM>
). This parameter determines which of the rendersettings
primitives will be the “default” for rendering.
You can override the default primitive in the viewport display settings, or by specifying a specific rendersettings
primitive when rendering with husk
.
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 rendersettings
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.
Denoiser
Choose a denoiser to run on the finished image output, or No Denoiser. This utility currently supports Intel Open Image Denoise (included with Houdini) and the NVIDIA OptiX Denoiser (must be installed separately). You must be on a supported platform and have the chosen denoising library installed for this to work.
The NVIDIA OptiX Denoiser only works with NVIDIA cards. It is now included with the NVIDIA driver (version 435 or later).
Denoise AOVs
The denoiser will be applied to the parameter’s space-separated list of AOVs.
Texture Maps ¶
This tab specifies AOVs that are defined as outputs of the shading state.
Normal Y Direction
Determines the direction of the Y value of the tangent-space normal (or rounded normal) AOVs.
Tangent Space Normal
Creates an AOV for the tangent space normal. You can change the AOV’s default Nt
name.
Rounded Normal
Creates an AOV for the rounded normal. You can change the AOV’s default Rn
name.
Rounded Edge Samples
Specify the number of directions to compute the rounded normal. More samples will take a longer time but produce a less noisy result.
Rounded Edge Ray Bias
The ray-bias for computing rounded normals to avoid self-intersection.
Rounded Edge Radius
The radius for the rounded normals.
Rounded Edge Cusp Angle
Polygons that have an angle less than this threshold will be assumed to be a smooth surface and not appear in the rounded normal map.
Rounded Edge Mode
Whether to capture concave or convex edges in the rounded edge normal map.
World Space
Whether the world space position should be recorded in left or right handed space with Y or Z as the up axis.
Position
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.
-
Low Res Mesh Bounding Box. The shading position is fit to the bounding box of the low-res 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.
Uniform Bounding Box (Not Stretched)
When you turn on this toggle, all three axes of the bounding box will have the same length. If unchecked, the box will fit the geometry tightly in all dimensions.
Normal
The shading normal. You can change the AOV’s default N
name.
Geometric Normal
The geometric shading normal (the face/non-interpolated normal). You can change the AOV’s default Ng
name.
Occlusion
Ambient occlusion. You can change the AOV’s default Oc
name.
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.
Curvature
The curvature at the shading position. You can change the AOV’s default Cu
name.
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.
Curvature Scale
Controls the overall intensity or contrast of the curvature by amplifying the difference between convex and concave responses.
Max Distance
Smaller values (= smaller distance) emphasize the concavity. Larger values (= greater distance) reveal more curvature and improve the visibility of the convex features.
Bias
Controls whether the map looks more concave or more convex. Smaller values emphasize concavity, higher values enhance convexity.
Cavity
The occlusion along the inverted normal at the shading position. This produces “relief” shading. You can change the AOV’s default Cv
name.
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.
Max Distance
Limits how far rays can detect nearby geometry. Smaller values (smaller distance) emphasize concavity.
Bias
Blends between full cavity contrast (0
) and a flat result (1
).
Thickness
The thickness at the shading position. You can change the AOV’s default Th
name.
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.
Edge
Identify edges in the high res model. You can change the AOV’s default Eg
name.
Edge Samples
Specify the number of directions to compute the Edge. More samples will take longer processing time, but produce a less noisy result.
Edge Ray Bias
The ray-bias for computing rounded normals to avoid self-intersection.
Edge Radius
The radius of the rounded edge.
Edge Cusp Angle
Polygons with an angle below this threshold are considered smooth and won’t appear in the Edge map.
Edge Mode
Types of edges (concave or convex) to smooth
Height
Displacement between the low-res mesh and the shading point as a scalar value. You can change the AOV’s default Ds
name.
Vector Displacement
Displacement between the low-res mesh and the shading point as a vector value. You can change the AOV’s default Vd
name.
Tangent-Space Vector Displacement
Displacement between the low-res mesh and the shading point as a tangent-space vector value. You can change the AOV’s default Vdt
name.
Alpha
The alpha at the shading position. You can change the AOV’s default Af
name.
Shader Values ¶
This folder specifies AOVs that are defined by the MtlX Standard Surface VOP shader’s inputs. Currently, you can only use inputs of 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. To write an AOV from a shader input, turn on its appropriate checkbox on the baker node. Since the mode of operation is the same for all inputs, they're not explained separately. The only exception is the Base Combined, because it’s not a separate input, but a combination of two AOVs.
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).
Lighting ¶
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.
Enable
Turn the AOV on or off.
Name
Specify the name of the AOV.
Type
The data type of the AOV
Source Name
The Source Type dropdown menu determines the name. For example, with the default LPE option, the source is a light path expression. With Primvar, you can enter the name of an attribute/primvar.
Source Type
Determines how the baker evaluates the Source Name parameter.
Baking ¶
This folder contains parameters that control the baking operations.
Make Low Res Mesh Invisible
In most cases, the low-res 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 low-res mesh remains visible.
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 low-res mesh to the scene, this bias is used to offset a ray’s origin from the surface of the low-res mesh. You can use this parameter to arbitrarily offset the low-res 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.
Low Res Normals
For texture baking to work, the Low Res Mesh should have normals. This parameter controls how the LOP will deal with low-res geometry that’s missing normals.
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.
Trace Set ¶
Trace sets are used to control which primitives are visible when computing ray tracing effects like occlusion, curvature, etc. There are two sides to trace sets when baking, identifying which trace set a primitive belongs to, and which primitives are visible to the trace set.
Each primitive can only belong to a single trace set, but each trace set can set their visibility to multiple trace sets.
For example, consider four trace sets named face
, body
, hands
and feet
. By setting the visibility on the face
set to self
(or face
), only primitives in the face
trace set will be used to compute Ambient Occlusion. Setting the visibility on the body
set to body feet hands
means that the body
, feet
and hands
will cast occlusion shadows when computing Ambient Occlusion on the body
primitives.
A string bake_traceset
primvar defines the trace sets on the low-res mesh. This is a single name and should match the identifying trace set defined on the high resolution mesh. If a trace set is defined on a low-res mesh primitive, the tracing rays are only tested against a set of high resolution geometries that are “grouped” under the same trace set name.
If a ray hits an object which doesn’t belong to this trace set, it’ll be ignored. And if no object under this trace set is hit, the ray is a miss.
Uncategorized Primitives
Determines the behavior of primitives that don’t belong to any trace set.
Global Visibility
These primitives will be part of the “global” trace set. All primitives in the hires mesh will affect ray tracing operations.
Combine Into Single Trace Set
Combine uncategorized primitives into a single trace set. Only primitives in this group will affect each other in ray tracing operations.
Separate Into Individual Trace Sets
Each uncategorized primitive will be put into a mutually exclusive trace set and not affected by other primitives.
Trace Sets
The number of explicit trace sets.
Enable
Turn on (or off) the creation of the trace set.
Name
Specify a name for the trace set.
Visibility
Specify the primitives visible to primitives in this trace set for ray tracing. This is specified as a space- or comma-separated list of other trace set names. Two special names are self
(only consider primitives in this trace set) and *
(consider all primitives).
-
If the visibility is
self
, only primitives in this trace set will be used for ray tracing operations. -
If the visibility is
*
, all primitives in the scene will affect the visibility of these primitives. -
You can also specify a pattern of trace set names which are used to determine visibility for ray-tracing operations. For example
body*
,face body hands
orface body* ^knapsack
to excludeknapsack
.
Primitives
The primitives that belong to this trace set.
See also |