Clamp

Clamps the output value of an input module.

In mathematics, clamp is a function that constrains a real number to an interval [a,b]: clamp(x) = max(a,min(x,b)).

If the output value from the source module is less than the lower bound of the clamping range, this noise module clamps that value to the lower bound. If the output value from the source module is greater than the upper bound of the clamping range, this noise module clamps that value to the upper bound.

This module will output values only between lower and upper bounds parameters.

Node inputs/outputs

The module’s constructor needs:

The output value is a Generation Module

Examples

Clamp a sine between -1 and 0 

Clamp a sine between -0.5 and 0.5 

Clamp a perlin between -1 and -0.5