Interoperability of Shader Graphs between 3ds Max and Stingray

Parent and child materials

When creating your shading network, you can save the graph as a preset and re-use it next time you create a new Stingray physically based shader (PBS) node. This allows you to avoid repeatedly creating identical shader graphs, making it harder to manage your materials and possibly lowering game performance.

A material containing a preset shader graph is called a parent material.

You can create child materials based on a parent material. A child material inherits the shader graph, and thus the material attributes, from the parent material.

Export a Stingray shader to Stingray and reuse an existing parent material

When you export a material from 3ds Max to Stingray, Stingray will not create a new parent material if your Stingray shader node points to an existing Stingray resource (a material in your Stingray project folder).

To point to this Stingray resource, set the Parent Material field in the DirectX material's Stingray rollout in 3ds Max.

You can only edit this field if you first do the following:

  1. In the DirectX Shader rollout, select Stingray from the list.
  2. In the Stingray rollout, select the Custom preset from the Preset Material list or click Make Unique (creates a custom preset).
  3. In the DirextX Shader rollout, click Open ShaderFX and then select the Standard Base node.

This prevents you from inadvertently changing your Parent Material path.

If this field is empty, the shader graph is considered a parent material. After you export this shader to Stingray, a new parent material is created.

If, on the other hand, you provide a path and resource name, for example:/content/materials/my_stingray_material; then upon export, the shader graph points to the parent graph at /content/materials/my_stingray_material. When it is imported in Stingray, Stingray will not re-create a parent graph. However, you must ensure that the graph in your ShaderFX editor in 3ds Max be the same as the parent graph in the Stingray game engine; that is, the one set in your path.

If you enter a path or a name in this field, but the parent material does not exist in your Stingray project folder, then a new parent material is created based on the graph you built.

Import a material from Stingray and use it as a preset

You can also create the parent graph in Stingray, then import it in the ShaderFX editor. To do this, select File > Import Graph, then select .material from the file type drop-down list.

To save this graph as a preset in 3ds Max, select File > Export Graph, and save it as a .sfx in renderData\shaders (to make it available for the current project) or \Documents\3dsMax\ShaderFX\Scenes\StingrayPBS (to make it available globally). It is now available as a preset under the Preset Material drop-down in the Stingray rollout.