Scalar Multi - Math

 
 
 

Category: Processing > Math

Shader Family: Texture

Output: Scalar

The Scalar Multi Math shader is an optimized version of the Scalar Math Basic shader. You can subtract/multiply/add up to eight scalar inputs.

Optimizations

Optimize Multiplication

If the last result or input is lower than or equal to 0, then the shader does not continue to evaluate the next input.

Optimize Subtraction

If the the last result or input is very high, the shader assumes that a subtraction would not lower the value to anything less than 1, so it does not evaluate the input.

Clamp

Clamp Min/Max

Clamps the output to the range set here. The output will not be lower than the Min value and not be higher than the Max value.

Inputs

You need to define a minimum of two inputs in order to perform mathematical operations between them. The inputs are processed in consecutive order; for example, Input 1 and Input2 do whatever operation is specified for Input 2 and that comes up with a value; then Input 3 does its operation on that resulting value, and so on.

Input 1

Defines the first scalar input.

It's best to use the texture with the largest scale and the least frequency as the first input.

If this input's value is lower than or equal to 0, then the shader does not continue to evaluate the next input.

Inputs 2 - 8

Each one defines another scalar input.

  • Operation: Sets the type of math operation to perform with this input and Input 1.

    • Add: adds the two input values together.

    • Subtract: subtracts this input value from the previous input value.

    • Multiply: multiplies the two input values together.

    • Input: Value from the input shader.

    • Intensity: Scales the input's Value.

Render Tree Usage

You can use this shader to to combine multiple scalar-output shaders (texture generators, fractal or cell scalar shaders, or other math shaders) to the Input parameters. This shader is used inside the Particle Shaper compound.

Once a function is selected, the output can be used on any shader that accepts a scalar input.

Here's an example of how the shader works for ICE particle shading:

You combine multiple density nodes inside the render tree, such as a big noise to shape ICE particle clouds (such as with the Cell Scalar shader) and a small noise for the edges to make it fluffier (such as with the Fractal Scalar shader).

  • If there is no big cloud, you don't need to make an emtpy space fluffy, so the shader does not call the second input.

  • If you are in the middle of the big cloud with full density, then you don't need to make that part fluffy. The fluffy noise is not able to reduce the high density to anything visible.

For general information about ICE particle shaders, see ICE Particle Shading [ICE Particle Simulations].