Go to: Related nodes. Attributes.

Triple Shading Switch is a utility node that enables you to switch between different values based on which surface is being shaded.

For example, say you have a complex shading network that is being used by many objects. However, two of these objects need to use different colors in one of the textures.

You could accomplish this by copying the entire shading network for each of these objects. But if you do that, any changes made to the shading network later will have to be repeated for each of the copies.

Instead of copying the network, just use one network with a Triple Shading Switch node. Connect the Output attribute of the Triple Shading Switch to the Color attribute of the texture. Set the Default attribute of the Triple Shading Switch to the color value used by most shapes. Then, for each object that needs a different color, specify the object and its particular value.

Now, you can assign the same shader to all the objects, and the objects that need the different color values will get them automatically.

Note: The Triple Shading Switch only works on triple-valued attributes, such as colors or xyz coordinates. If you need to switch single attributes (such as Intensity of Translucence), use a Single Shading Switch. If you need to switch double attributes, such as UV coordinates, use a Double Shading switch.

In the table below, important attributes have their names listed in bold in the description column.

This node is MP safe

Node nameParentsClassificationMFn typeCompatible function sets
tripleShadingSwitchbaseShadingSwitchutility/switchkTripleShadingSwitchkBase
kNamedObject
kDependencyNode
kTripleShadingSwitch

Related nodes

blendColors, clamp, lightInfo, gammaCorrect, surfaceLuminance, contrast, luminance, rgbToHsv, hsvToRgb, samplerInfo, setRange, resolution, renderQuality, renderGlobals, renderGlobalsList, baseShadingSwitch, singleShadingSwitch, doubleShadingSwitch

Attributes (14)

defComp1, defComp2, defComp3, default, inComp1, inComp2, inComp3, inShape, inTriple, input, outComp1, outComp2, outComp3, output

Long name (short name)TypeDefaultFlags
input (i) compoundn/aarrayoutputinputconnectablestorable
Input is a combination of two attributes, a triple value and the name of a shape. This is also a multiple attribute, so you can specify any number of these value/shape pairs.

During rendering, the Output attribute is set depending on which object is being rendered. When one of the objects in in this list are being rendered, then Output is set to its corresponding value. When none of the objects in this list is being rendered, Output is set to equal Default.

inTriple (it) float3outputinputconnectablestorablekeyable
InTriple is the "Value" component of Input (see above).
inComp1 (ic1) float0.0outputinputconnectablestorable
The first component of InTriple
inComp2 (ic2) float0.0outputinputconnectablestorable
The second component of InTriple
inComp3 (ic3) float0.0outputinputconnectablestorable
The third component of InTriple
inShape (is) Messagen/aoutputinputconnectable
inShape in the "Shape" component of Input (see above).
default (def) float30.8, 0.8, 0.8outputinputconnectablestorablekeyable
Default is the value used by this node when it is not rendering one of the nodes on the Input list..
defComp1 (dc1) float0.0outputinputconnectablestorable
The first component of Default
defComp2 (dc2) float0.0outputinputconnectablestorable
The second component of Default
defComp3 (dc3) float0.0outputinputconnectablestorable
The third component of Default
output (out) float30.0, 0.0, 0.0outputconnectable
Output is the Output value of the switch. This value depends on what shape is being rendered. When one of the objects in the Input list is being rendered, then Output is set to its corresponding value. When none of the objects in the list is being rendered, Output is set to equal Default.
outComp1 (oc1) float0.0outputconnectable
The first component of Output
outComp2 (oc2) float0.0outputconnectable
The second component of Output
outComp3 (oc3) float0.0outputconnectable
The third component of Output