How to Clamp Values in Blender Math Node

Clamping values in Blender allows you to restrict numerical data so it stays strictly within a specified minimum and maximum range. This guide covers how to use the built-in clamp feature on standard Math nodes, how to set custom min and max limits using the Clamp operation, and alternative node setups for precise value control in both Shader Editor and Geometry Nodes.

Using the Built-In Clamp Checkbox

The simplest way to clamp an output to a standard range of 0.0 to 1.0 is by using the built-in checkbox on any Math node:

  1. Open the Shader Editor, Compositor, or Geometry Nodes workspace.
  2. Press Shift + A, navigate to Converter, and select Math.
  3. Set up your mathematical operation (e.g., Add, Multiply, Power).
  4. Enable the Clamp checkbox located near the bottom of the Math node.

Any resulting value lower than 0.0 automatically becomes 0.0, and any value higher than 1.0 automatically becomes 1.0.

Using the Clamp Operation Mode for Custom Limits

When you need limits other than 0.0 and 1.0, use the dedicated Clamp operation within the Math node:

  1. Add a Math node (Shift + A > Converter > Math).
  2. Click the operation dropdown menu (defaults to Add) and select Clamp (listed under the Functions category).
  3. Connect your input signal into the Value socket.
  4. Set your desired lower threshold in the Min field.
  5. Set your desired upper threshold in the Max field.

The output will now strictly remain between your defined Min and Max boundaries.

Alternative Clamping Nodes

  • Dedicated Clamp Node: Blender provides a separate Clamp node (Shift + A > Converter > Clamp) that offers identical functionality to the Clamp operation mode, featuring Min, Max, and Value inputs.
  • Map Range Node: Use a Map Range node (Shift + A > Converter > Map Range) if you need to rescale values while keeping them clamped. Enable the Clamp option at the bottom of the Map Range node to ensure the remapped output does not exceed the target range limits.