Go to: Related nodes. Attributes.

Double 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 have different UV coordintate values set in one of the texture placements.

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 Double Shading Switch node. Connect the Output attribute of the Double Shading Switch to the uvCoord attribute of the texture. Set the Default attribute of the Double Shading Switch to the value used by most shapes. Then, for each object that needs a different value, 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 UV Coord values will get them automatically.

Note: The Double Shading Switch only works on double-valued attributes. If you need to switch single attributes (such as Intensity of Translucence), use a Single Shading Switch. If you need to switch triple attributes, such as 3d coordinates, or colors, use a Triple 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
doubleShadingSwitchbaseShadingSwitchutility/switch:drawdb/shader/operation/doubleShadingSwitchkDoubleShadingSwitchkBase
kNamedObject
kDependencyNode
kDoubleShadingSwitch

Related nodes

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

Attributes (11)

defComp1, defComp2, default, inComp1, inComp2, inDouble, inShape, input, outComp1, outComp2, output

Long name (short name)TypeDefaultFlags
input (i) compoundn/aarrayoutputinputconnectablestorable
Input is a combination of two attributes, a double 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.

inDouble (idl) float2outputinputconnectablestorablekeyable
InDouble is the "Value" component of Input (see above).
inComp1 (ic1) float0.0outputinputconnectablestorable
The first component of.InDouble
inComp2 (ic2) float0.0outputinputconnectablestorable
The second component of InDouble
inShape (is) Messagen/aoutputinputconnectable
inShape in the "Shape" component of Input (see above).
default (def) float20.0, 0.0outputinputconnectablestorablekeyable
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
output (out) float20.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