October 28, 2018
In this training we'll learn how to properly setup a linear workflow in RenderMan for Maya, while explaining the benefits of handling gamma and color profiles properly.
In practical terms, Linear workflow refers to a rendering workflow in which image gamma is carefully taken into account in order to ensure proper light computations in a render.
In other words, we'll be able to turn...
LW is especially important for the shading system of RIS, because it makes sure proper light computations are made in what is a physically based system.
Linear workflow is the correct mathematical workflow for computer graphics and by consequence not a system motivated by aesthetics (unless photorealism is considered one), as artistic liberties can be taken with computer graphics at any point, including lighting and shading.
There are many different gamma standards within the various color profiles out there, so we need to make some choices (and assumptions) regarding our simple imaging pipeline:
What does all this LW talk mean exactly?
To oversimplify things, let's break down an entire rendering pipeline into three simple steps:
For a Linear Workflow to work:
All calculations need to happen in linear gamma, but all viewing (input/ output) needs to happen in sRGB gamma.
Something like this.
Why do we need linear gamma?
Why do we need to view in sRGB?
This would be simple enough if every software would play by the same rules, but they don't. In fact, the default gamma workflow for many 3D software is incorrect. This is where the knowledge of a proper imaging workflow comes in to save the day.
Let's visualize what we know so far.
This is the default in most applications including Maya.
No INPUTS are color managed, therefore all the CALCULATIONS happen incorrectly and the OUTPUT display is linear. Which translates into wrong colors, wrong light and wrong display.
This is incorrect.
This is another common example of bad color management.
No INPUTS are color managed, therefore all the CALCULATIONS happen incorrectly, but the OUTPUT display is in sRGB. Which translates into wrong colors, wrong light, but proper display.
This is also incorrect.
This is a render with Linear Workflow.
All INPUTS are color managed, therefore all CALCULATIONS happen correctly and the OUTPUT display is sRGB. Which translates into correct colors, correct light and proper display.
This is correct!
Which brings us to the only natural question anyone can ask after seeing this... How do I do this?
How do we make inputs linear?
Thankfully RenderMan can interpret Maya's color management perfectly.
First, let's make sure we understand one thing in the diagram above...
Values are not color corrected, only colors are.
So all that theory is great and all, but let's look at the practical side of this workflow. We'll divide it in native Maya nodes and Pixar nodes.
In practical terms we need to enable color management from the Maya preferences, under Windows > Settings/Preferences > Preferences > Color Management.
Well, first we want to enable Color Management, secondly we want to tell Maya that our images will be rendered in Linear Space, and that we will be looking at them with a sRGB LUT, or Look Up Table. This applies the color profile to the viewer and simulates what will be burned into the image after finalizing the image in post, like so:
We could also add rules to our project. This can help us apply the correct color profile, or lack thereof, to a certain group of images, based on extension names and/or a pattern in the naming convention. For example: Bump will tell Maya to apply the rule to any images that come in with the word Bump in the name.
In my case I've told Maya not to change the color profile of Bump, this will maintain my painted values intact as they drive shader values.
The wildcards on both ends (*), tell Maya that this pattern can be anywhere in the name of the file.
Another very important gamma correction that needs to happen is to our swatches, also called pots or color pickers.
We are picking colors in the sRGB values of our monitors, so it is not linear. To compensate, Maya can apply a LUT to the swatch so that we are picking in the right color space.
If you're using PxrTexture instead of Maya file nodes to read textures, you need to linearize textures manually. Thankfully, PxrTexture has a simple Linearize checkbox you can enable if you need to gamma correct your texture.
Now that we have effectively modified the input images, we need to view them correctly.
How do we view outputs with an sRGB LUT?
To study a practical example, download and open the supplied project.
In depth gamma information which escapes the scope of this training can be found in numerous internet articles such as Charles Poynton's Gamma Faq and the Color Management section of the Maya user guide.
From pitch to delivery, Leif Pedersen is a CG Generalist who's worn many hats in production for over 10 years. His background in traditional arts mixed with technical foundations has allowed him to work with a varied client list in both television and commercial work, and has now joined Pixar's RenderMan team.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.