MaterialX

Example MaterialX Files


The MaterialX distribution includes a number of example MaterialX files demonstrating MaterialX XML syntax and sample materials based on the StandardSurface or UsdPreviewSurface shaders.

Syntax Examples

Nodegraph Examples

  • NodeGraphs.mtlx

    Defines 2 nodegraphs:

    • "nodegraph1" = Basic image access (Example 1 from the Nodes section of the Spec)
    • "nodegraph2" = A full nodegraph with tokens
  • CustomNode.mtlx

    Defines a custom node using a nodegraph, then uses that node in another nodegraph.

  • MultiOutput.mtlx

    Declares a node with multiple outputs and uses it in a nodegraph.

  • SubGraphs.mtlx

    Defines a "checker" custom node using a nodegraph, uses that to define another "color_checker" custom node, then uses that to multiply an image by a two-color checkerboard.

Material Examples

  • SimpleSrf.mtlx

    A nodedef for a "simple_srf" shader, with output type "surfaceshader".

  • PaintMaterials.mtlx

    Defines a "paint_flat" material, then defines "paint_semigloss" and "paint_gloss" materials which inherit from "paint_flat". Uses an XInclude to reference "SimpleSrf.mtlx".

  • PreShaderComposite.mtlx

    Example of pre-shade blending of surface material properties. (Example 2 from the Materials section of the Spec)

  • PostShaderComposite.mtlx

    Example of post-shade blending of surface material properties. (Example 3 from the Materials section of the Spec)

Look Examples

  • Looks.mtlx

    A fairly complete example file, defining two shader nodes, five materials, several collections, a variantset with three variations, an asset light, a propertyset, and two looks assigning various combinations of the above as well as a few standalone properties.

Example StandardSurface Materials

Sample materials in the StandardSurface Examples folder in the MaterialX Distribution include: brass_tiled, carpaint, chrome, copper, default, emission, glass, gold, greysphere, jade, marble_solid, plastic, sheen, velvet and wood_tiled. Also included are example looks based on brass_tiled and wood_tiled, as well as a greysphere_calibration material used to place a calibration color ring on the greysphere material for the ShaderBall object.

Example UsdPreviewSurface Materials

Sample materials in the UsdPreviewSurface Examples folder in the MaterialX Distribution include: brass_tiled, default, glass, gold and plastic.