Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After baking is done, the next step is to run ‘txmake’ on each image to create a MIP-mapped cache-friendly texture in .tex format. These textures can then be read during rendering using e.g. OSL’s texture() function. Figure 2(right) shows the Cornell box and diffuse sphere shaded using the precomputed illumination textures (while the reflection in the specular sphere is rendered with ray tracing).

Similar to pattern baking, you may specify which texture coordinates are used for the output manifold. The default texture coordinates are ``st''.
Additionally you may choose to invert the ``t'' direction. The invert default is true.

Code Block
Hider "bake"
"string bakemode" ["integrator"]
"string[2] primvar" ["foo" "bar"]
"int invert" [0]

Atlas Images

Multiple outputs can be generated if the texture coordinates for the selected output extend outside the [0,1) range. In this case, the filename should contain a special atlas wildcard to generate a unique output name for each image tile.

Code Block
Attribute "user" "string filename" "box_direct.<UDIM>.tif"

In this case, the (s,t) texture coordinate of each baked point gets mapped to a UV tile such as 1001. The supported atlas wildcards are:

  • <udim> or <UDIM> (i.e.\ Udim tile: 1001, 1002, 1003, ...)
  • <u> and <v> (i.e.\ tile indices starting at zero: 0, 1, 2, ...)
  • <U> and <V> (i.e.\ tile indices starting at one: 1, 2, 3, ...)