In Blender Cycles, in Shader nodes, the MixRGB node has an option "Clamp" that says: "Clamp result of the node to the 0..1 range". I can't think of a scenario where the node would output a result that's outside of this range. There's already a factor slider to mix the two color inputs, and for each color input, the slider options are already clamped between 0 and 1.

What is a scenario of when the MixRGB node would output a result that's outside the 0-1 range (and therefore is a case where "Clamp" can be useful)?


The mix node can produce results outside of the 0-1 range. For example, white divided by (almost) black gives a very high value. Take a look at this node setup:

enter image description here

I took 2 mix nodes, set them both to add, gave them both an input of '1' (white), and subtracted the end result with '1'. The final result of the nodes without clamping is '1' (white), while the result of the nodes with clamping is '0' (black).

  • $\begingroup$ “Black” and “white” do not exist in the scene referred models used by raytracers. The results will be wrong. Clamp is purely useful for normalized data driven needs in the 0.0 to 1.0 range, and will introduce problematic issues when used on colours. Even a “simple” invert will fail. $\endgroup$ – troy_s Sep 4 '16 at 0:04

It is useful for when some data operations must be within a normalized range.

It is not useful when dealing with scene referred renders coming from Cycles, as the range of intensity values go from zero to infinity. Within a scene referred model, there is no notion of white nor black, and both of those concepts arise only when transformed to the display referred domain.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.