View Full Version : ranges

12-06-2012, 06:43 AM
How i can adapt a range from x to y to a range from 0 to 1 in glsl?
for example : if i have a x = -20 and a y = 200 how to fit in a 0 to 1 range?
there is an already done function?

12-07-2012, 01:20 AM
Nope there isn't. The example isn't very helpful. Normalizing values is only helpful if you have a minimum and maximum you want to push the values into so the min value maps to 0 and the max value maps to 1.