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 Mon, 13 April 2009 at 5:28 PM

Quote - Next question.

Gamma correction is necessary only for image files used in a shader and only for diffuse or specular channels.  [ T / F]

False on many levels. You conflated several questions and asked it wrong.  Let me re-assemble the question in various forms, leaving out or adding certain words, and answer each:

Gamma correction is necessary ... for images files used in a shader ?

Incoming images are either linear (such as HDR images) already or gamma corrected which require anti-GC measures to make them linear. In no case would you want to gamma correct them. Did you mean to ask about anti-GC? Images such as JPEG photos should be anti-gamma corrected, to make them linear, if they are not already linear. HDR and EXR images are supposed to be linear already. Some are not. If it looks right, it's not linear, and you need to anti-GC it.

*[Anti] Gamma correction is necessary only for images ... ?

False. Any color parameters chosen on the basis of how they look on the screen (such as from a color picker) must be entered in linear representation, or you risk shifting hues and saturation around. For example, the color sRGB(255, 128, 64) is not the actual linear color value you should use. In order to do proper linear math with that color, you should anti-GC it. Notice I said sRGB to indicate I'm talking about the values you read off from picking or sampling a color on the screen and then examining what RGB values you got. Consider if you used that color with a 50% light. What should the on-screen color end up being, half those values? Nope, because half of those would not be half as luminous.

In general, if the color you like in your sample or color picker is X, then you should be using X ** 2.2 in the script.

By the way, in all your scripts, you keep writing very long things like:

gamma = Add(2.2)
color = ImageMap("blah blah")
gamma_pow = Color_Pow(color, gamma)

I find this incredibly tedious to read, as I have to study many characters to see what you did.

This gets the exact same job done:

ImageMap("blah blah") ** 2.2

Also, the lovely thing about this expression is that if "color" is really just a color, then you don't need any nodes, and matmatic will just do the conversion for you, for example:

IColor(255, 128, 64) ** 2.2 # will result in the linear representation of what 255, 128, 64 looks like on the screen

*[Anti] Gamma correction ... only for diffuse or specular channels.

False. It is also needed for any incoming material that is coming from gamma corrected sources. In particular, reflections coming from other GC shaders on other surfaces are in sRGB color space, not linear color space, and have to be anti-gamma corrected before you use them in calculations.

Quote -
Since bump and displacement don't use colour information, it is not necessary to perform gamma correction on dedicated bump and/or displacement files, [ T / F]

True.

Quote -

or node-based colours and textures.[ T / F]

True, assuming you anti-GC'd any colors that you fed to those nodes from outside. Remember, that includes images and colors you manually enter into parameters.


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)