RobynsVeil opened this issue on Jan 24, 2009 · 490 posts
bagginsbill posted Sun, 25 January 2009 at 6:05 PM
Negatives and numbers bigger than 1 exist and are used on purpose in shaders. Correcto.
Tip: When we don't want a calculation to go outside the unit-range we "Clamp" it.
Math:Clamp is what you use. In my notation,
Clamp(x) is always at least 0 and at most 1, by definition.
Mathematically the following is true:
when 0 <= x <= 1 , Clamp(x) = x
when x < 0, Clamp(x) = 0
when x > 1, Clamp(x) = 1
This is the definition of Clamp.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)