Linear Workflow: A Guide

This has been the subject of discussions on many forums over recent years. I realized that there were all sorts of tutorials offering often conflicting information regarding the process. This is not the only way, just my way. I would like to thank my mates Ben Cowell and Phil Shoebottom for offering some clarity on a few points.

What is "Linear Workflow"?

Look at Fig.01. What is the difference between the image on the left and the image on the right? The truth is; nothing at all, except the way your monitor is showing you the image.

Fig. 01

Fig. 01

V-Ray and 3ds Max process the data in which to make an image in "linear space", also known as Gamma 1.0, but by default all monitors show you the image with a Gamma of 2.2 (sRGB), which basically makes the image look dark, although it actually isn't dark at all. The program just assumes that you are viewing the image with Gamma set to 1.0, instead of 2.2, until you tell it otherwise.

Unfortunately this has always been the case with 3D rendering, which means that many artists who don't know about linear workflow learn to light scenes by using a handful of tricks to try and get results you'd expect in real life. Things like adding more lights, boosting the Environment/GI levels to incredibly high values, adding some ambient lights with shadows turned off, etc. This all adds to the amount of calculations being made by the renderer for no real reason, as all of the data is in fact already there, providing you tell the program to show it to you correctly.

Setting up 3ds Max

As well as the image itself, textures and materials also need to be correctly converted to Gamma 2.2. Note that V-Ray will ignore all of the Gamma settings in the 3ds Max dialog. We do this step in order to set up the Material Editor to render its thumbnails with linear workflow so that we get an accurate representation of what materials in our render will look like. It's worth noting that you can render in linear space in V-Ray without touching these setting at all, but you won't be able to use the Material Editor thumbnails to accurately tune your shaders.

Go to Customize > Preferences > Gamma and LUT. Change the settings to those shown in Fig.02.

Fig. 02

Fig. 02

As I said, V-Ray ignores the Gamma settings, but it doesn't ignore the Input Gamma in the Bitmap Files box. By setting this to 2.2 you will globally effect how textures are loaded in. Don't change the Output Gamma as this will burn in the Gamma correction to rendered images, which limits what you can do to the image in post.

Most images you find on the internet or from your digital camera will be sRGB (Gamma 2.2) already so it is just easier to assume 2.2 from the beginning. Some files are natively linear (like HDRIs) so will not require correcting to 2.2; you also do not want to correct Normal maps or Displacement as they won't work properly. For these images the best thing to do is override the Gamma settings on a case by case basis as you import them into your scene (Fig.03).

Fig. 03

Fig. 03

3ds Max is now set up correctly, so set up your scene and create a render using the V-Ray Frame Buffer.

Setting up V-Ray

First step, go to V-Ray's Color Mapping dropdown menu, change the Gamma to 2.2 and tick Don't affect colors (adaption only) (Fig.04).

Fig. 04

Fig. 04

The advantage of ticking Don't affect colors (adaption only) is that the Gamma 2.2 will not be burnt in to the final image, however V-Ray will proceed with all its calculations as though color mapping is applied. In effect this enables V-Ray to calculate better noise samples as it is sampling a brighter image, so the differences between light and dark tones are easier to detect.

The image you save out is still linear, so we still have the flexibility of compositing in linear space.
The V-Ray Frame Buffer also ignores the 3ds Max Gamma settings, so the render may come out looking very dark. You will need to click the sRGB button at the bottom, which is V-Ray's own Gamma correction. Note that this is only for displaying purposes; the image is still linear. As you can see, Fig.05 - 06 is now displaying a linear image corrected to be viewed at Gamma 2.2.

Fig.05

Fig.05

Fig.06

Fig.06

You will notice that from now on light will fill every corner of the image without the need to add a load more lights or boost any settings to unnatural levels. You will also notice that the image will not burn out nearly as much as before. This is basically because when you want to brighten the dark areas by adding more lights, this still contributes to the light areas, so you will inevitably end up with ranges that exceed pure white (255, 255, 255).

File Formats and Rendering

Compositing in 32-bit has been used in feature films for years. Color correction is much more flexible, especially when controlling highlights. The ideal solution is to export a linear image like EXR or DPX for example. With linear images all of the pixel data is mathematically correct as opposed to looking correct, resulting in accurate and predictable results when adding or multiplying in post. After Effects and Nuke can be setup to view linear images in sRGB colorspace, composited in 32-bit and then exported at 8-bit for broadcast.

When saving linear images, 8-bit formats will most likely result in some color banding. There often isn't enough range in 8-bit colourspace to represent a complete tonal range when working with linear images. So whenever possible always render out to either 16-bit (TIFs or SGIs) or 32-bit (EXRs, DPX).

Never use JPEGs for rendering as JPEG compression is optimized for nonlinear images and will throw away much of the data required for Gamma translations to and from linear space.

Burning the Gamma in

Burning the Gamma in will limit what you do in post, but if you want to then simply un-tick Don't affect colors (adaption only) in V-Ray's Color Mapping dropdown menu (Fig.07).

Fig. 07

Fig. 07

You can tell this has worked because you can view the same image, but without having to click the sRGB button in the V-Ray Frame Buffer. You will notice that if you click the sRGB button it will preview Gamma correction on top of that, resulting in a washed out image (Fig.08). You get a similar result if you duplicate the image to the Max Frame Buffer. This is because we set Max to Gamma 2.2.

The Magic Linear Workflow Button

This button is a little misleading. It looks like if you tick it, then you will magically get proper linear workflow... but no, you don't. This button is basically a quick and brutal way of correcting the V-Ray materials that were not setup and tuned with linear workflow in mind. I wouldn't use this (Fig.09).

Fig. 09

Fig. 09

And that's pretty much it really!

Fetching comments...

Post a comment