0
$\begingroup$

I have few questions regarding tone-mapping and gamma correction.

  1. is a tone-mapping operator a function whose output is a value between [0,1] ? If this isn't the case and since gamma encoding requires a value to be in range [0,1], do I need to normalize the values after tone-mapping?

  2. imagine a diffuse horizontal surface with (0.5,0.5,0.5) reflectance under an unobstructed uniform sky of radiance (1,1,1) cd/m2. The incident radiance on an image pixel coming off this surface will have value of (0.5,0.5,0.5). Now, most codes I have seen apply gamma encoding(raising pxl value to the power of 0.45) at this stage just before saving it to the file. But on viewing the image, the colors are distorted and much brighter corresponding to (186,186,186) color value. If I don't apply gamma encoding then the image file displays the expected color that is (127,127,127).

If the CRT monitor or the LCD does apply the inverse of gamma, then by encoding it I must see the original color that is (127,127,127), is that right? And if I am seeing (186,186,186) instead, am I right therefore to assume the encoding happens internally on saving the image data as png or jpg format? and therefore I don't need to do any gamma encoding?

$\endgroup$
2
$\begingroup$

the colors are distorted and much brighter corresponding to (186,186,186) color value. If I don't apply gamma encoding then the image file displays the expected color that is (127,127,127).

No, the gamma-correct color is not distorted; your expectations are. If your lighting, meshes, textures, and other scene elements were not built to be properly linear and gamma correct to the screen, then every decision you have made has been through a distorted lens. If you don't like the effect you're getting with a properly gamma-correct lighting system, that's the fault of all of those decisions you've been making, not with gamma correction.

Half of the full lighting intensity in a linear colorspace does correspond to greater than half in a gamma-correct colorspace. And those gamma-correct values are what you ought to be passing to the screen. If that's not what you're shoving into the display, then you're doing lighting wrong.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ At this point it would be good to undetstand differences between humanities and sciences. Humanities deal with relative statements and sciences deal with how things work. As art is generally a humanist endeavour an artist might say that it looks good everything is hunky dory. Thats fine. However from a sientist perspective its still wrong because there are so many implied assumptions that are wrong in such a setup. You simply miss on a lot of refinements if you side step this. Everything from antialias and shading routines are slightly off. You can tweak things but would be better if not. $\endgroup$ – joojaa May 1 at 10:57
  • $\begingroup$ @nicol Thanks. So do you mean that the material reflectance must first be gamma corrected (raised to the power of gamma) before doing the ray tracing ? In other words, if I am setting up my materials using any Color Picker app, are the RGB values already in non-linear space? and therefore I first need to convert it to linear space before feeding it to ray tracing? $\endgroup$ – ali May 1 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.