Skip to content
On this page

Simplygon Shading Networks

What is a shading network ?

Shading networks are a fundamental part of Simplygon's material pipeline and are used to describe Simplygon materials in a hierarchial node-based manner. Most shading nodes supported by the Simplygon API are supported by the plug-in and the input for the nodes matches the ones in the API.

Most standard materials in Max gets automatically translated to and from Simplygon materials during export and import, but there are some cases where user input is required. DirectX materials with custom (HLSL) shaders do not follow any template / naming schema that we can use to automatically map the material properties, for these materials shading networks have to be setup manually.

Max 2021 introduces a new material model as standard material, specifically the Physical Material. As the material is very complex with many material properties we've added shading network support to open up new possibilities.

Fundamentals

A material in Simplygon can have several material channels, for example Ambient_Color, Diffuse_Color, Specular_Color and Bump which can be found in standard materials in Max, or Ambient, Diffuse, Specular and Normals which will be used in HLSL examples later on. There are also possibility to add custom channels, if needed. Each of these material channels has its own shading network which is Simplygon’s way of describing a material.

Shading networks are responsible for the visual representation of a material, as well as a description of what will be baked during processing. A shading network starts with one node, an exit node which can be of any (shading) node type, for example a texture-, add- or multiply node.

Supported shading nodes

Max NameAPI NameNo of InputsDescription
ShadingTextureNodespShadingTextureNode0Points at a texture
ShadingColorNodespShadingColorNode1RGBA color
ShadingAddNodespShadingAddNode2Adds two input nodes together
ShadingSubtractNodespShadingSubtractNode2Subtracts input 1 from input 0
ShadingMultiplyNodespShadingMultiplyNode2Multiplies input 1 with input 0
ShadingDivideNodespShadingDivideNode2Divides input 0 with input 1
ShadingInterpolateNodespShadingInterpolateNode3Interpolates input 0 and 1 based on 2
ShadingClampNodespShadingClampNode3Clamps input 0 based on 1 and 2
ShadingSwizzlingNodespShadingSwizzlingNode4Swizzles the channels
ShadingVertexColorNodespShadingVertexColorNode0Points at a vertex color set
ShadingLayeredBlendNodespShadingLayeredBlendNode (internal)unlimitedBlends textures together from start to end, based on blend mode
ShadingPowNodespShadingPowNode2The power (input 1) of input 0
ShadingStepNodespShadingStepNode2Steps up/down the values from input 0 based on input 1
ShadingNormalize3NodespShadingNormalize3Node1Normalizes input 0
ShadingSqrtNodespShadingSqrtNode1Sqrt of input 0
ShadingDot3NodespShadingDot3Node2Dot of input 0 and input 1
ShadingCross3NodespShadingCross3Node2Cross of input 0 and input 1
ShadingCosNodespShadingCosNode1Cos of input 0
ShadingSinNodespShadingSinNode1Sin of input 0
ShadingMaxNodespShadingMaxNode2Max of input 0 and input 1
ShadingMinNodespShadingMinNode2Min of input 0 and input 1
ShadingEqualNodespShadingEqualNode21.0f if value in input 0 equals the value in input 1, otherwise 0.0f
ShadingNotEqualNodespShadingNotEqualNode21.0f if value in input 0 does not equal the value in input 1, otherwise 0.0f
ShadingGreaterThanNodespShadingGreaterThanNode21.0f if value in input 0 is greater than the value in input 1, otherwise 0.0f
ShadingLessThanNodespShadingLessThanNode21.0f if value in input 0 is smaller than the value in input 1, otherwise 0.0f
ShadingGeometryFieldNodespShadingGeometryFieldNode0Returns field data from geometry based on specified field type, name (or index)

Next steps

Get to know how to work with Shading Networks: