# Geometry Node: Simplest way to restrict value of a field

Let's say, in geometry nodes I have a vector field that is obtained from Color output of the Noise Texture. Now I want to restrict its x, y, z values to make them lie only within the range of 0 and 1. I can, of course, use the Map Range node, but it requires the input value range, and for this I will have to use something like Attribute Statistic to get get min and max of each of the x, y, z values of the vector. I want to avoid it if possible.

So, what is the simplest way I can restrict the value of a field to make it lie within a range (like 0 to 1) regardless of the input value range?

Edit: As pointed out by @Nathan in the comment, noise output is already within the range of 0-1. So the example in my original question should be changed to anything other than 0-1, let's say 0-0.5. My question is given any arbitrary input range, can we restrict the output to a fixed range without requiring the minimum and maximum values of the input range?

• Are you looking for math/minimum and math/maximum? Simple ways to clamp anything, including an attribute. Or you are looking to normalize the ouput around all possible values? Not doable in GN-- requires image processing techniques, and may only be valid for certain domains and sampling rates. Note that noise texture output lies within 0,1 anyways. Jan 5, 2023 at 5:31
• @Nathan Thanks, I have edited the question to change the example range for noise texture. I am not sure if math/min would help in this case. Please have a look at the edit. Jan 5, 2023 at 7:05
• Are you aware of the clamp node ? docs.blender.org/manual/en/2.93/modeling/geometry_nodes/… Separate XYZ > 3*Clamp > Combine XYZ Jan 5, 2023 at 7:27
• @Gorgious Could you post your reply as an answer, so that I can accept it. Jan 6, 2023 at 9:58
• Sorry don't have the time right now. But You can answer your own question with your solution. Cheers :) Jan 6, 2023 at 10:36

As Gorgious correctly pointed out in the comments, you can solve this by splitting the vector into its components and using the Clamp node for each float value:
Alternatively, you can use the vector nodes Minimum and Maximum directly:
By the way: The node Noise Texture should actually always return a value between $$(0,0,0)$$ and $$(1,1,1)$$, and therefore this should not be necessary in this case.