Math Operation Textures
Math Operation nodes include Unary, Binary, Random Map and Range. These are standard OSL functions, useful for those who do not wish to write OSL (Open Shading Language) scripts. More information on OSL can be found in this document.
Add a Math Operation Node
To add a Math Operation node, click on the Custom Texture item in the Texture Group. A list will appear with a variety of choices, including the Math Operation nodes. Drag the desired node into the workspace.
Unary Math Operations
The Unary Math node takes a single input and outputs the result based upon one of the operations listed below:
- Absolute Value
- Exponential [2^x]
- Exponential [e^x]
- Exponential [e^x-1]
- Fraction
- Inverse square root
- Invert
- Logarithm Base 10
- Logarithm Base 2
- Logarithm Base e
- Logarithm Base radix
- Negate
- Reciprocal
- Sign
- Square Root
There are two Conversion operations:
- Degrees
- Radians
There are four rounding operations:
- Round
- Round Down
- Round Up
- Truncate
There are nine trigonometric operations:
- Arc Cosine
- Arc Sine
- Arc Tangent
- Cosine
- Hyperbolic Cosine
- Hyperbolic Sine
- Hyperbolic Tangent
- Sine
- Tangent
Binary Math Operations
The Binary Math node takes two inputs and will use the two inputs as operands for the operations listed below:
- Add
- Cross Product
- Divide
- Dot Product
- Exponential [a^b]
- Logarithm [log_b(a)]
- Multiply
- Remainder (always positive)
- Remainder ((keeps sign of a)
- Subtract
There are also two Comparison operations:
- Maximum Value
- Minimum Value
And one Trigonometric operation:
- Arc tangent
Random Map
The Random Map node will randomize the input texture with the selected Noise function (Perlin, Unsigned Perlin, Cell and Hash). The Scale slider will attenuate the result.
random map node |
- Input Texture — This is the texture to operate upon. It can be an Image Texture or Procedural.
- Noise Function — This option determines the function used to generate the random values.
- Perlin — Standard Perlin noise pattern, with a range of -1 to 1.
- Unsigned Perlin — Perlin noise, with a range of 0 to 1.
- Cell — Cellular noise, aka "Worley" noise, with a range of 0 to 1.
- Hash — The classic random noise pattern, with a range of 0 to 1.
- Input Scale — The scale of the randomization. Higher values cause repeating patterns.
Range
The Range texture node will take the incoming value (single value, gradient, etc.) and set the input min and max values, along with the output min and max values, per the Interpolation value set in the Interpolation drop down menu.
range texture node |
The options are explained below:
- Value — The input of the Range node.
- Interpolation — The method used to interpolate the input value:
- Linear — The full range specified by the Input and Output settings.
- Steps — The non-smoothed output of the Input and Output range, divided by the Steps value.
- Smooth Steps — The non-smoothed output of the Input and Output range, divided by the Steps value, which is then smoothed.
- Smoother Steps — The non-smoothed output of the Input and Output range, divided by the Steps value, which is smoothed by a different algorithm than the Smooth Steps option.
- Input Min & Max — The min & max of the values input to the node.
- Output Min & Max — The min & max of the values output from the node.
- Steps — The amount of steps used when Interpolation is set to one of the Stepped methods.
- Clamp — Clamps the input to the Input Range.