Values from 0-1 evenly steped,how?

I have tryed to get a evenly steped gradient,that has a radius value from 0 to 1.
In my example i multipled the gradient to a value of 5 to getting “rounding steps”,and then divided it back by 5 to get the range back to 0 to 1.

The gamma is only insert for better display,has nothing to do with the math itself.

Maybe there is a simple solution,but i can not get a evenly steped gradient from 0 to 1 with evenly spaced and valued colors.

What i tryed is floor.(Gives from the center 0, 0.2, 0.4, 0.6, 0.8)


ceil (gives from center 0.2 0.4 0.6 0.8 1 )

round (from center 0 0.2 0.4 0.6 0.8 1 )

Round is what i basicly want from the values,but its not evenly spaced.I have tryed snap as well but i can not get a fitting result with it.

Someone a idea?

Would subtracting one from the divide value do what you want?

2 Likes

It works very well with the value of 5.Thank you very much.
Have to check other values,so far so good.

There’s actually node for that - snap:


Will make it cleaner.

3 Likes

Thanks,snap with substract have to check this.

My color picker shows raw non-tonemapped values as 0.0,0.2,0.4,0.6,0.8 and 1.0:

(The video will take a while to process to HD resolution)
The subtract node is actually same as invert, only it doesn’t unnecessarily convert float to RGB and back to float.

I have tryed snap but i dont get the range form 0 - 1. (If i am not wrong,then In you video the bright parts are not 1 neither)

Watch the color picker values. It shows two value types, raw and tone mapped. The reason it shows gray is that the final render is tone mapped. You can disable tone mapping to see the raw values.

I have selected standard CM to get the values from 0 - 1 displayed.

Yes have looked again,you maybe right.However with the same Texture coordinate object setup i got different results.

You have gamma node in there :slight_smile:

But anyway, rest is up to you to figure out :wink:

I have gamma in the posting of Strike_Digitals solution test as well,showing values from 0 - 1

Map Range and Colorramp could this too.
Colorramp gives more controll.

1 Like