Go to:
Related nodes. Attributes.
Set Range is a utility node that allows you to take
values in one range, and map them into another range.
For example: Say you have an rotation attribute whose value goes from
0 to 360. You want to use this attribute to drive a color
value, which goes from 0 to 1.
To do this: Set the Old Min and Old Max attributes to the range
the the incoming attribute has, in this case 0 to 360.
Set the Min and Max attributes to the desired range, in this
case 0 to 1.
Connect your rotation attribute to the Value attribute.
Once that is done, the Out Value attribute of this node will provide
you with numbers between 0 and 1, that you can use for your color.
The input of Set Range is a triple value, so you can use it for
vectors, or colors. If you want to set the range for single values,
just use one of the X, Y, or Z channels.
Here is the mathematical calculation done by this node:
OutValue = Min + (((Value-OldMin)/(OldMax-OldMin)) * (Max-Min))
In the table below, important attributes have their names listed
in bold in the description column.
Node name | Parents | Classification | MFn type | Compatible function sets |
---|
setRange | node | utility/general:drawdb/shader/operation/setRange | kSetRange | kBase kNamedObject kDependencyNode kSetRange |
Related nodes
blendColors, clamp, lightInfo, gammaCorrect, surfaceLuminance, contrast, luminance, rgbToHsv, hsvToRgb, samplerInfo, resolution, renderQuality, renderGlobals, renderGlobalsList, baseShadingSwitch, singleShadingSwitch, doubleShadingSwitch, tripleShadingSwitch
Attributes (24)
max, maxX, maxY, maxZ, min, minX, minY, minZ, oldMax, oldMaxX, oldMaxY, oldMaxZ, oldMin, oldMinX, oldMinY, oldMinZ, outValue, outValueX, outValueY, outValueZ, value, valueX, valueY, valueZ
Long name (short name) | Type | Default | Flags |
---|
|
max
(m )
| float3 | 0.0, 0.0, 0.0 | |
|
|
|
|
|
min
(n )
| float3 | 0.0, 0.0, 0.0 | |
|
|
|
|
|
oldMax
(om )
| float3 | 0.0, 0.0, 0.0 | |
|
|
|
|
|
oldMin
(on )
| float3 | 0.0, 0.0, 0.0 | |
|
|
|
|
|
outValue
(o )
| float3 | 0.0, 0.0, 0.0 | |
|
| outValueX
(ox )
| float | 0.0 | | |
|
| outValueY
(oy )
| float | 0.0 | | |
|
| outValueZ
(oz )
| float | 0.0 | | |
|
|
value
(v )
| float3 | 0.0, 0.0, 0.0 | |
|
|
|
|