Forum: Poser - OFFICIAL


Subject: Monthly reminder - you need to gamma correct your renders

bagginsbill opened this issue on Feb 01, 2009 · 207 posts


bagginsbill posted Thu, 16 April 2009 at 9:31 AM

There are some interesting and surprising ramifications of doing everything linearly.

Consider creating a gradient from pure 100% BLUE to pure 100% RED. What color would be in the middle, and how bright should it be? Intuition tells me that it should be a MAGENTA hue in the middle, but how bright?

Consider this script:

a = Color(0, 0, 1)
b = Color(1, 0, 0)

x = (U - .5) * 1.5 + .5
nonLinearGradient = Blend(a, b, x).labelled("nonLinearGradient")
linearGradient = Blend(a ** 2.2, b ** 2.2, x).labelled("linearGradient") ** (1/2.2)

combination = Blend(linearGradient, nonLinearGradient, .5 <= V)

Surface(0,0,0,0, Alternate_Diffuse = combination)

If you put that on a square, it renders the non-linear gradient on the upper half and the linear gradient on the lower half.

The linear gradient produces a bright magenta, because both of the end colors are bright. The non-linear gradient produces a very dark magenta, and the red and blue each dominate until you're nearly in the middle. The linear gradient is the correct path through the color space from blue to red. The non-linear gradient deviates towards black in the middle of the transition, because those colors with darker values for red and blue do not display with the correct luminance.


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)