Comprehensive information on gamma correction in 3ds Max & V-Ray. Examples, theory, and step-by-step instructions illustrated with the corresponding screenshots. If you want to know what gamma correction is, why it is important for photorealistic 3D visualization, and how to apply it to your workflow, this tutorial will help you. If you are not a 3ds Max or V-Ray user, you will still find something useful here, because gamma correction an application independent concept.
This tutorial was written in times of 3ds Max 2008 and V-Ray 1.5. Back then, Input and Output Gamma values for both, 3ds max and for V-Ray were linear, ie 1.0 by default. In order to get 3D visualizations that look right, they need to be brought to gamma 2.2, or rather to say, the rendering software must take into account gamma correction, especially when working with raster (textures, renderer output). Therefore, the software must be configured to work with gamma 2.2. This mini-tutorial actually describes gamma 2.2 setup process on 3ds Max and V-Ray example.
Very quickly, photorealistic rendering from fancy 3d-award galleries smoothly migrates to everyday life and became a industrial standard, especially for product renderings and architectural visualizations. A little time has passed (6 years actually) since this tutorial was written, when it became clear to many software developers that gamma 2.2 should be defaulted to 3D rendering programs, including 3ds Max developers. Thus, for 3ds Max 2014 and later versions, Gamma 2.2 has become a default value. V-Ray developers have also adapted to this.
Nowadays, overall "gamma related things" become much easier and slightly differs from described here. Lets say, you no longer need to setup gamma correction on 3ds max first install.
Despite most of default gamma troubles is gone, the current tutorial written in educational story style and can be useful for anyone who is interested in "Input" and "Output" Gamma concepts and setup methods for the raster maps in 3ds max!
If you just need instructions on setting up a workflow for gamma 2.2 in 3ds Max & V-Ray, but you are not interested in gamma correction theory, you can proceed directly to: Gamma 2.2 Quick Setup Guide.
In most images, really important information is concentrated in light tones, where black tones take up the same amount of space (in terms of image file size), but contain mostly indistinguishable details. As you know, humans do not see in the dark. Therefore, software and hardware developers put forward the idea of gradient compression. Where most of the gradient space is given to the light tones, at the same time the black tones are "squized" in a small area. Gamma correction is the algorithm of such gradient compression. So, in short, gamma correction is about compressing an image gradients in order to reduce the size of bitmaps. Number 2.2 is the amount of compression that developers consider optimal and accepted as a standard for storing and displaying images across various devices. As follows, the value of 2.2 is a common value that is followed by most developers.
3D artists who work closely with images can no longer set aside gamma correction to make sure their rendering looks the same on all devices. Gamma 2.2 is naturally adapted by masters of photorealistic 3D-visualization around the world.
Many artists, especially those who faced the rendering of the interiors noticed that with physically correct formulation of the lights there is an overall dark-fetched result in illumination. That is noticeable in the corners and on the shadow side of objects especially.
Everyone tried to deal with this issue in different ways. Beginners immediately tried to correct this by simply increasing the brightness of lights.
This approach brings some results increasing the overall illumination. However, it also led to no less unlikely overbrights made by these light sources. This does not alter the situation with unrealistic image. One bug of darkness (in the hard-to-reach for light places) is replaced by another bug of overbrights (near the light sources).
Someone used more complex ways to "solve" the problem by adding extra lights, and making them not visible to the camera so dark places were simply illuminated. However, with this way no physical accuracy and realism of the image could not be considered. Along with lighting of the dark places, shadows disappeared and was the impression that the scene objects are flying in the air.
All of the above ways of dealing with implausible darkness rather far-fetched than elegant solutions :)
The heart of the problem of dark renders is in that the image and monitor gamma values are different.
Gamma is the degree of nonlinearity of the color gradient from dark to bright values. In mathematical point of view the linear gamma value is 1.0 and this is why software such as Max, V-Ray by default performs calculations in the gamma 1.0. But the gamma 1.0 value is consistent only with the "perfect" monitor, which has a linear dependence of the display from white to black. Because there is no such monitors, the actual gamma of devices is nonlinear.
The gamma value for the video standard NTSC is 2.2. For computer displays the gamma value is typically between 1.5 and 2.0. But for convenience the nonlinearity of the color gradient on all screens is considered as 2.2.
When the monitor with gamma 2.2 shows an image with a gamma 1.0 we get dark gamma 1.0 colors instead of needed gamma 2.2 bright ones. So the middle-range colors (Zone 2) become dark when viewing the gamma 1.0 image with the gamma 2.2 output device. However, in range of dark tones (Zone 1), gamma 1.0 and 2.2 representation is quite similar, what lets to display the shadows and black colors properly.
In the areas of light tones (Zone 3) there also are the great similarities. Therefore, bright gamma 1.0 image is also quite correctly displayed on the gamma 2.2 monitor.
And so, in order to get at the appropriate output in Gamma 2.2 the source image gamma should be modified. Surely this can be done in Photoshop, simply by adjusting gamma there. But each time to change the image settings, saving them to your hard disk, and editing in raster editor can hardly be called convenient. Because of that we will not consider this option, and in addition this method provides an even more significant deficiencies. Modern renderers, such as V-Ray, calculate the image adaptively, so the calculation accuracy depends on many parameters, including the light brightness in the area. Therefore, in the shadow areas image is calculated less accurately and become noisy. And in the bright and visible areas the calculation passes with more accuracy and with minimal artifacts. This allows faster renders due to the saving time on a slightly visible areas. By raising the output image gamma in Photoshop you change the brightness of those parts, which renderer considered as a less significant and reduced the quality of a calculation. Thus, all unwanted artifacts become prominent, and the picture will look awful, but more bright than before :) In addition the gamma of textures also will change and they will look pale and discolored.
The only correct way out of this situation is the changing the gamma value in which the renderer is working. That way you will get an acceptable brightness in the midtones and there will no obvious artifacts, as when changing gamma in raster editor.
We will show you how this is done in V-Ray renderer and 3ds Max.
To change the gamma in which the renderer will work with it's enough to find drop-down tab named "V-Rray: Color mapping" in the "V-Ray" tab on the "Render Scene:" (F10) window, and set the value "Gamma:" to 2.2.
A feature of V-Ray renderer is that the color mapping gamma correction works in the V-Ray Frame buffer only, so if you want to see the results of your manipulation with gamma it is necessary to turn on frame buffer on "V-Ray: Frame buffer" in the "V-Ray" tab.
After this the resulting rendered image will be with needed gamma 2.2, with a normal lit midtones. Yet another disadvantage is that the textures which are used in the scene will be lighter and will look discolored and faded.
Almost all textures we use have a normal appearance on monitor. That is because of they are already adjusted by the monitor and have a range of 2.2 initially. In order the renderer to configure a gamma 2.2, and to not to set image gamma at 2,2 × 2,2 value, textures must be in the gamma 1.0. Then, after their correction by renderer their gamma will become 2.2.
You can make all textures darker, by setting their gamma from 2.2 to 1.0 in raster editor, counting on further lightening by renderer. However, that approach would be very tedious and will require time and patience to ensure that every texture in the scene are in 1.0 gamma, and secondly it will make impossible the viewing the textures in the normal gamma because they will be shaded at that time. To avoid this, just force them to adjust the 3ds Max input. Fortunately this 3d editor has enough settings as for the gamma. Gamma settings available from 3ds Max main menu:
Customize > Preferences ... > Gamma and LUT
The main 3ds Max gamma settings are in the "Gamma and LUT" tab. In particular, we need input texture correction setting named "Input Gamma". We should not delude ourselves that there is a default value of 1.0. This is not the adjustment value, this is an input texture gamma value. By default it is considered that all the textures is composed in a gamma 1.0, but in reality as previously mentioned they are at gamma 2.2. And that what we must specify the 2.2 instead of 1.0 default value.
Don't forget to enable "Enable Gamma / LUT Correction" checkbox to access the gamma settings.
Images made with that gamma settings look much better and more correct than those that were obtained by using the settings described a little earlier. They have correct mid-tones, there are no over-brights near the lights and no artifacts in slightly lit areas. In that way textures will also be saturated and bright.
It seems that's all, but finally we would like to tell about one more thing in the work with gamma. Since the renderer operates in a unusual gamma we got to set 3ds Max display mode to gamma 2.2 for "Material Editor" and "Color Selector" colors to become correct. Otherwise there may be a confusion, as the apparent tuning of materials will be produced in gamma 1.0, but actually inside the program it will be transformed into gamma 2.2.
To set the correct display of materials in the "Material Editor", you should use the settings in the "Gamma and LUT" tab. For this the 2.2 value of Gamma in "Display" segment and checkboxes "Affect Color Selectors" and "Affect Material Editor" in a "Materials and Colors" segment must be set.
Gamma 2.2 has become the standard for many 3d professionals working with 3ds Max and V-Ray. We hope that this lesson will help you to correctly configure your workflow in 3d!
The expressions "in gamma" or "at gamma" should be read as "for gamma". So, the expression "image in gamma 2.2" or "image at gamma 2.2" means nothing but "image for presentation by a system with a decoding value of γ equal 2.2".
Please share if you like it!