Note: In 3ds Max 2018.4 Update, the Stingray physically-based shader is renamed
Interactive.
To avoid repeatedly creating identical shader graphs and slowing down your project, you can create and save a preset shader graph and later re-use this preset when you want to create a new Interactive shader.
- Create an Interactive shader node.
- In the DirectX material's Interactive rollout, select Custom from the Preset Material list.
The Parent Material field is now empty.
- In the DirectX Shader rollout, click Open ShaderFX and then build your graph.
- (Optional) Select the Standard Base node in the ShaderFX editor. In the Properties, provide a path and resource name, for example:/content/materials/my_interactive_material in the Parent Material attribute. Now, upon export to Max Interactive, the shader graph points to the parent graph at/content/materials/my_interactive_material. When the shader is imported in Max Interactive, it will not re-create a parent graph. However, you must ensure the graph in your ShaderFX editor in 3ds Max is the same as the parent graph in the Max Interactive engine; that is, the one set in your path.
- In the ShaderFX File menu, select
File > Export Graph
.
-
Save your SFX file to one of the following:
- To make the preset available for only the current project, save to the project directory, renderData\shaders folder.
- To make the preset globally available to all projects, save to \Documents\3dsMax\ShaderFX\Scenes\StingrayPBS.
- (Optional) Rename your shader node for easy identification when you import your FBX file into a game engine. If you are exporting to Max Interactive using the Interactive menu, you can also enter a name for your material in the Engine Resource attribute in the Interactive rollout, and this name will be used as the material name in Max Interactive.
- Now when you restart 3ds Max and create a new Interactive PBS node, you can find your preset in the Preset Material drop-down list. Select your preset to reuse the same shader graph. You can continue to use the preset as long as you only change the attributes and not the shader graph.
Application of custom presets
Parent and child materials
A material that contains a 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.
Child materials can modify the attributes of the parent material; for example, its color values and texture maps. Generally speaking, these are attributes that are visible in the Interactive PBS Attribute Editor. However, a child material cannot change the parent material's shader graph.
If you have a team of soccer players in your scene, you can create one shader graph to shade all of their t-shirts.
Create one parent material with a preset shader graph, then create 10 child materials based on the parent. Each child material Attribute Editor can connect to a different texture that represents the player name and number. Because the 10 child materials do not have a shader graph connected, they are much faster to calculate, reducing the performance hit.
Create a custom preset with an existing shader graph
- From the Preset Material list, select the preset with the shader graph you want to start building from.
- Click Make Unique. The Interactive shader node no longer points to the previously selected preset; however, the shader graph is maintained when you click Open ShaderFX.
- In the Interactive PBS shader Attribute Editor, select the preset you want to edit from the Preset Material drop-down list.
- Click Open ShaderFX to open the ShaderFX editor window. A message in the ShaderFX editor informs you that this graph is inherited from the preset graph; in this case, your custom preset.
- Edit the graph, then select File > Export Graph and save the preset under its existing filename to replace the previous version.