In 3ds Max we need to manage our inputs to make sure they will be linear during shading/calculations/rendering. As we linearize our images, they will start to look too dark. To compensate for this 3ds Max offers Gamma correction of the viewport. Furthermore, when calculations are done we end up with a linear image and therefore need to apply a Look Up Table (LUT) in the Frame Buffer to preview the image in sRGB.
First we need to setup 3ds Max for proper viewport display. As of more recent versions of the software, Gamma is set to 2.2 by default. However, if you're still working with old scenes and have adopted their settings, it's good to know how you can set it back to how it should be. To change the settings go to Customize > Preferences > Gamma and LUT tab:
Double check that Enable Gamma/LUT Correction is checked. This will ensure that you’re utilizing Max’s gamma correction environment.
Click the Gamma button under Display and make sure it’s set to 2.2. This is basically enabling gamma correction in the Max interface and will force your viewports to show the expected brightness.
Check both Affect Color Selectors and Affect Material Editor under Materials and Colors. This forces Max to correct the gamma in the Material Editor and also the Color Selector so you see what’s expected.
This is the most tricky and daunting part of Linear Workflow - you need to manage all your input textures. There is a simple rule that needs to be followed: values are not color corrected, only colors are.
Knowing this, here is a list of some of the common maps under these categories (the ones most often used are in bold):
Diffuse/Albedo maps
Reflection Color maps (although you shouldn't use reflection maps)
Refraction Color maps
Fog Color maps
Translucency Color maps
Subsurface Color maps
Glossiness maps
Bump maps
Normal maps
Displacement maps
Reflection maps driving values (greyscale)
Refraction maps driving values (greyscale)
Anisotropy Amount maps
Anisotropy Rotation maps
Translucency maps driving values (greyscale)
Image format is also important. Some files such as EXR, HDR or Float Tif are usually in Linear space and therefore do not need any Gamma correction.
With V-Ray, 3ds Max offers two options for image inputs: VRayHDRI Map (Recommended) and Bitmap. Here is how you should setup each of them for Color and Value Maps:
VRayHDRI - Color Maps
In the Color Space tab, set Type to sRGB.
Once Type is set to sRGB, Inverse gamma value has no effect.
VRayHDRI - Value Maps
In the Color Space tab, set Type to Inverse Gamma.
In the Inverse Gamma tab, set the value to 1.0.
This is how a VRayHDRI Map is set by default.
Bitmap - Color Maps
Select the Color Map you want to open.
Under Gamma check Override and set it to 2.2.
Bitmap - Value Maps
Select the Value Map you want to open.
Under Gamma check Override and set it to 1.0.
Automatic (Recommended) option when loading textures with Bitmap: this option will apply Gamma 1.0 to all images in floating point format automatically (HDR, EXR, Float TIF) - so for these types of images you should leave it selected. All other images will be treated as sRGB so by default it will apply a Gamma of 2.2. This means that you can load all your Color Maps with Automatic selected and use the Override option only for Value Maps.
Important: even though the described above should be the default behavior of the Automatic option, it might be setup to treat all images as Linear by default (instead of sRGB) and apply a Gamma of 1.0. To check this, when importing a normal sRGB image, turn on the Override (with value of 1.0) option and then switch back to Automatic. If the small preview image changes its brightness (Override=1.0 will brighten and going back to Automatic will darken) when switching back and forth between the two options, this means that the Automatic option treats sRGB images with Gamma 2.2. If both options show the same brightened result, this means that all images are treated with Gamma 1.0 (as Linear images). This means that Automatic option should be used for Value Maps and for Color Maps you will need to select Override and set it to 2.2.
Confused? That's why it's always safer to set the Gamma manually via the Override option.
Tip: When you look at your map tree, all Value Maps should look brighter than when viewed through a standard picture viewer. All Color Maps should look exactly the same as they appear if you open them through a picture viewer. What happens is that Color Maps are darkened but then 3ds Max Gamma brightens them again for correct preview in the viewport. Because Value Maps are left alone and not darkened, the 3ds Max Gamma makes them appear brighter. With time you will get used to how a certain map should appear in the material editor and you will know if the Gamma is wrong.
When working in Linear Workflow, color swatches in 3ds Max work with Linear values. This doesn't matter much if we want to put a random color in and eyeball what we want to achieve. However, if we want to use a specific color given by a client, we will have a problem - this color will be in sRGB.
If we input sRGB values where we must put Linear values we will get a different color. The color will be brighter. We have a few options to fix this:
Let's say our clients' product is in Stone Blue - the color above. If we sample it, its sRGB values are 121, 151, 161. Let's see how we can get the same color in 3ds Max.
We can make a 128x128px image in Photoshop filled with this color. We can then open it up as a texture and treat it as a Color Map and apply Override Gamma 2.2 on import.
Create a 128x128px image in Photoshop filled with color
Open it with Override Gamma 2.2
First, input the sRGB values into a VRayColor map. As mentioned, the color will be too bright. As you put sRGB color values in Linear space you need to convert them back. To do this apply a Color Correction map and use Gamma 0.45. Now you have the same color. You don't want to clutter our materials with excessive Color Correction maps, so you can go back to the VRayColor map node and pick the resulting color from the Color Correction map. Delete the Color Correction map afterwards. You've successfully converted an sRGB color into a Linear color. If you check the values in the VRayColor map, you will see that the Linear representation of the color 121, 151, 161 is 49, 82, 93 (a much darker color).
Create a VRayColor map and input the sRGB color
Create a Color Correction map
Change Gamma to 0.45
Go back to the VRayColor and use the color picker to sample the color in the Color Correction map
Delete the Color Correction map
The guys from Corona have developed an amazing Color Picker which can switch between Linear and sRGB modes. It also samples sRGB values correctly - you can pick colors directly from desktop, Photoshop or a web page with this picker end they will be directly converted into Linear color. You can even use HEX codes or color temperature. You also have options to display colors in values between 0-1 and 0-100% which is quite useful when setting up values like Glossiness for example.
Here is how the picker looks. Hex codes are always in sRGB. If the sRGB option is enabled, input values will be in sRGB. If it's disabled, values will be in Linear.
To use it you need to install a Demo version of Corona and then set it as the default Color Picker by going into Customize > Preferences > General and at the bottom of UI Display tab you can change your Color Selector to Corona Improved Picker.
All three methods illustrated above will give the same end result. Some are faster than others and I strongly recommend the last one as this will boost your workflow in the long term.
If you're still unclear on what is the difference between sRGB and Linear color values, you can check the Understanding Reflectance Values part of the Materialism 101 article.
Of course, the most important maps to keep track of are the Color Maps. If they don't have correct Gamma on input, you won't have correct colors. However, you will most certainly have unwanted results if you mess up the Gamma input of a Value Map. Let's explore three examples with some of the most common textures which do not need Gamma correction: Glossiness, Normal and Displacement.
Getting the Gamma input wrong for Glossiness maps is not the biggest of problems when compared to Normal and Displacement maps as you can always use Color Correction to "fix" them or adjust them to your liking. However, wrong representation is still a wrong representation. Using Glossiness maps with sRGB Gamma will darken them and introduce more contrast. Check the example below.
Normal maps in particular will have the most negative consequences when loaded with incorrect Gamma input. They will produce all sorts of shading artifacts and light will be rendered in a seriously broken way when hitting objects that have the Normal map applied.
As mentioned before, when working in Linear Workflow, artists start to notice if a map is loaded incorrectly simply by seeing its preview in the material editor. Normal maps should look bright and washed-out. If the preview looks like the image on the far right, then the map was loaded as an sRGB image instead of a Linear one.
If you feel that you need to understand how Normal maps work and haven't done so already, check the Normal Map part of the Materialism 101 article.
The map on the left has been loaded without Gamma correction as a Linear image (Gamma Override=1.0 for Bitmap or Inverse Gamma = 1.0 for VRayHDRI map). The map on the right has been loaded as an sRGB image. Obvious shading artifacts appear. This is the worst map in terms of wrong Gamma input.
This texture has been made in Photoshop. UP is completely white and DOWN is completely black. Gamma won't affect these values as it only affects the midtones. The grey is 50% (128, 128, 128 RGB). Made in such a way, it is expected that UP and DOWN will be displaced evenly. For this to happen we would like to treat the 50% grey color as a Linear color. When the texture is loaded, no Gamma correction should be applied.
If, insead, the texture is loaded as an sRGB image, the 50% grey will be linearized during rendering and therefore darkened. Instead of having 128, 128, 128 RGB, it will be rendered as 55, 55, 55 RGB which will make the UP more extruded than the DOWN.
If you're note sure how Displacement works, check the Displacement part of the Materialism 101 article.
The map on the left has been loaded without Gamma correction as a Linear image (Gamma Override=1.0 for Bitmap or Inverse Gamma = 1.0 for VRayHDRI map). The map on the right has been loaded as an sRGB image which darkens the midtones and therefore renders what was supposed to be mid-grey color a bit darker.
Just like 3ds Max, V-Ray is also set up for Linear Workflow by default. You will find the settings in the the VRay tab in Max’s Render Setup in the Color mapping section. This is how it should look:
Make sure that Type is set to Linear multiply. We want full control of our image as we are going to be doing compositing in linear space. All other modes alter the image and clamp colors. This is the most appropriate mode for Linear Workflow as it doesn't change anything in the render. You can find more about it here.
Set Gamma to 2.2. This guarantees that V-Ray is performing calculations to the brighter gamma corrected image and not to the darker uncorrected image. This can be especially important for reducing noise and flicker.
Make sure Mode is set to Color mapping only (no gamma). We want the effect of the color mapping to affect our renders, but don’t want to burn the 2.2 gamma into our final images as we want to do compositing in linear space.
Do not enable the Linear workflow option. This is used only to convert old scenes into Linear Workflow and it doesn't do a great job at it as it can't make all corrections properly.
Render your tests using the V-Ray Framebuffer (VFB), and be sure that sRGB is turned on in the VFB preview window. Since we are not baking the 2.2 gamma curve into the renders, we need the VFB to add a 2.2 gamma curve to the preview. Otherwise, the render will appear to be too dark and any attempt to brighten them without using the sRGB button would be incorrect.
Finally, when outputting renderings from 3ds Max, they need to be saved in floating point .EXR format. We save them as Linear images (we don't embed the sRGB curve we use in the Frame Buffer for previewing) so we can continue working in Linear Workflow during compositing. Here are the settings:
Make sure you set the Format to Half Float (16 bits/Channel). In cases where there is a lot of contrast in the scene (i.e. looking towards the sun), Format can be set to Full Float (32 bits/Channel).
Set Type to RGBA to ensure images retain their Alpha Channel.
Set Compression to ZIP to save space.
When opening old files, made with a legacy workflow (meaning Non-Linear Workflow), don't forget that you need to adopt their Gamma settings so materials and viewport are previewed correctly for this particular project.
For proper Linear Workflow all calculations need to happen in Linear space
Input textures need to be Gamma-managed
We split Input textures into two groups - Color Maps and Value Maps
Color Maps need to be loaded with Gamma 2.2 (sRGB) while Value Maps need to be loaded with Gamma 1.0 (Linear)
3ds Max Color Picker works with Linear values and sRGB values that we get from web colors need to be converted to Linear values
Both 3ds Max and V-Ray have settings that need to be setup for correct Linear Workflow
Outputs are previewed with a sRGB curve through the Frame Buffer
Outputs are saved as Linear images in floating point .EXR format