Baking in ShaderFX

The following workflow is applicable to both Shaderfx Shader graphs and Stingray PBS graphs.

You can bake any preview swatch in your ShaderFX graph to a flat 2kx2k texture. In addition, you can also bake the unwrapped UV's of your geometry to a texture.

Baking preview swatch to a texture

To save your preview swatch to a flat, square, 2kx2k texture

  1. Select the node with the preview swatch that you want to bake.
  2. Right-click and select Tools > Save Selected Swatches to Images.

To bake to a larger swatch size, use the shaderfx MEL command with the -renderSwatchToDisk flag.

Rendering geometry into a ShaderFX swatch

To visualize your viewport geometry in the ShaderFX swatches

  1. Select the geometry in the scene view.
  2. -click and select Tools > Set Swatch Geometry.

If you rotate your camera, you must select View > Select Camera in the panel menu, then select Tools > Set Swatch Camera in the ShaderFX marking menu to update the swatches in ShaderFX.

Bake the UV unwrapped image to a texture

  1. Select the node with the preview swatch that you want to bake.
  2. Right-click and select Tools > Save Selected Swatches to UV-unwrapped Image.

    Select Tools > Save Selected Swatches to UV-unwrapped Image.

    The unwrapped UV's of your geometry are baked to the file.

    Note: The TraditionalGameSurfaceShader bakes all the lighting, so faces that are not being lit appear as black in the baked result.

Application

You can mix expensive noise and patterns, then bake and export them to a game engine. ShaderFX lets you stitch together nodes, preview them real time in Viewport 2.0, then bake out a UV based texture for your object.