Gamma Correction and Linear Workflow

The Gamma Correction attributes are deprecated and no longer appear in Maya 2017. You should be using Maya's native Color Management settings. More information about using Color Management with MtoA in Maya 2017 can be found here.

 

Gamma correction controls are helpful for users to make sure they are working in radiometrically linear space (also called 'linear workflow'). Linear workflow ensures that all of the elements interacting in a scene (light colors, textures and shader colors) correspond linearily with actual amounts of light so that the renderer does proper light computations in a physically accurate way. This is needed since light works linearly in the physical world (if you double the amount of photons, the color values are also doubled).

 

While all the calculations need to happen in a linear color space, all viewing devices (input and output) will need to be shown in a gamma corrected space (like sRGB gamma).

The main problem when rendering without a proper linear workflow is that lights look overblown and colors look unnatural. The artist then tries to adjust their scene's lighting, falloff, colors etc. However this is only possible to a certain extent. The images below show common mistakes artists make when rendering out images with differing gamma outputs:

It is recommended that you output rendered images as EXR (linear floating point format) in order to maintain a linear workflow. 

 

The rendering pipeline can be broken down into the following steps:

How to make inputs linearly

Images rendered to disk (using batch render for example) need to be viewed with a LUT capable image viewer. When viewed through a standard non LUT capable viewer, the rendered images will look too dark in comparison.

 

MtoA does not currently support the new Autodesk syncolor color management with file nodes. This means that you must either setup the global textures gamma from the renderer settings, handle the gamma manually with gamma nodes in the Hypershade or pre-linearize the textures using maketx. The last option is best because you are avoiding any extra computation at render time. You can specify a proper sRGB correction or a more complex space correction (Arnold only does a simply pow). From a mathematical point of view the color correction should happen at the lookup level before OIIO does the texture filtering and this is the only method that can take this into account.

Arnold scans the contents of a texture (it does not rely on the extension) and anything that is not float is considered to have a gamma baked even if the image has a different color space embedded.


Tx Texture Format

You can convert your textures to linear space with the make tx tool. This way you can ensure that all of your textures are linear before rendering. You can choose between linear, sRGB and Rec709. For example, the following command:

maketx --colorconvert sRGB linear C:\solidangle\mtoadeploy\2016\bin\crayons.jpg

Crayons.jpg image color space converted using the make tx tool

Tx Manager

Textures can also easily be converted to the .tx format using the TX Manager which has an options box that enables you to add parameters to the conversion process.

Tx Manager window with 'maketx --colorconvert sRGB linear' option


Manual Linear Workflow

We can also manage linear workflow by ourselves without relying on Arnold. This can be done via the following steps:

  • Set your Render View > Display to 32-bit floating-point (HDR). 

 

  • Open ViewColorManager in the Attribute Editor (Render View > Color Management).  Set the Image Color Profile to Linear sRGB.

'Linear sRGB' tells the Render View window that incoming images are Linear

 

  • Render to Open EXR.
  • Setup the following Arnold gamma settings such as:


The shader and light gamma are set to 2.2 because versions of Maya < 2015 won't allow you to color correct the color swatch widgets.

 

Color Management

Here is a basic workflow for color management with Arnold and the more recent Maya releases.

  • Enable Color Management in Maya.
  • Set all your gamma controls in the Arnold render settings to 1.0. This means that Arnold expects all color and images to be linear.
  • The MtoA Display Gamma applies to the render view only, and can be set to 1 if you're letting Maya handle the display color management.
  • If you are using a solid color, set the color in the color picker: to match a specific sRGB value, set the “mixing color space” to “Display Space” and enter the sRGB value – what you see in the swatch will be what you render.
  • If you are using a file texture, linearize the file first before you load it into Maya (you can linearize as part of converting to .tx).

 

File textures

MtoA does not support the new Autodesk syncolor color management on the file nodes. This means that you must do one of the following:


Pre-linearize the textures with maketx (and set the Arnold Textures gamma to 1)
or
set the global Texture Gamma in the Arnold Renderer Settings 
or
handle the gamma manually with gamma nodes in the hypershade (and set the Arnold Textures gamma to 1).

Pre-linearizing the textures is the best option, because you avoid any extra computation at render time, you can specify a proper sRGB correction or a more complex space correction (Arnold only does a simple pow) and last, but not least, from a mathematical point of view the color correction should happen at the lookup level before OIIO does the texture filtering and this is the only method that can take into account this.

  • No labels