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 name | Parents | Classification | MFn type | Compatible function sets |
---|
doubleShadingSwitch | baseShadingSwitch | utility/switch:drawdb/shader/operation/doubleShadingSwitch | kDoubleShadingSwitch | kBase 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) | Type | Default | Flags |
---|
|
input
(i )
| compound | n/a | |
|
|
|
|
default
(def )
| float2 | 0.0, 0.0 | |
|
|
|
|
output
(out )
| float2 | 0.0, 0.0 | |
|
| outComp1
(oc1 )
| float | 0.0 | | |
|
| outComp2
(oc2 )
| float | 0.0 | | |
|