Sample Files

The MaterialX distribution includes a number of example MaterialX files, described below.

Nodegraph Examples

  • NodeGraphs.mtlx

    Defines 3 nodegraphs:

    • "nodegraph1" = Basic image access (Example 1 from the spec)
    • "nodegraph2" = Basic layered image access (Example 2 from the spec)
    • "nodegraph3" = Full nodegraph with tokens; used by MaterialGraphs.mtlx
  • CustomNode.mtlx

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

  • SubGraphs.mtlx

    Defines a "checker" custom node using a nodegraph, then uses that node to define another "color_checker" node, then uses that node 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 material "paint_flat", and then "paint_semigloss" and "paint_gloss" which inherit from "paint_flat". Includes "SimpleSrf.mtlx"

  • GeomInfos.mtlx

    Example declarations of collections and geominfos; used by MaterialGraphs.mtlx

  • MaterialGraphs.mtlx

    Declares two shader nodes and then two materials using them; connects to a nodegraph output defined by NodeGraphs.mtlx, and uses geometry attributes defined in Geominfos.mtlx to perform geometry-specific image filename substitution.

  • PreShaderComposite.mtlx

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

  • PostShaderComposite.mtlx

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

Look Examples

  • Looks.mtlx

    A fairly complete example file, defining 4 materials, several collections, an asset light, a propertyset, and two looks assigning various combinations of the above as well as a few standalone properties.