Linear workflow 'reloaded'
In March 2004, Rob Nederhorst posted an interesting thread on the support forum of Vray and a couple of other forums about working in linear space. Although the thread answered a couple of questions it also generated a lot of questions and confusion about this workflow. In the following article, I have tried to summarize these as well as take away any doubt people might have after reading the article. I have written it in interview style, which I hope, makes it better readible.
O.K., I calibrated my monitor with a hardware calibrator, selected a gamma of 2.2 and a whitepoint of 6500K. Now the article suggest to do the gamma correction in 3dsmax again, what's happening here?
In fact, you are mixing up two things. First of all, hardware calibration of your monitor is a very good first step. When you are working with an LCD screen, calibration is even more essential. If you don't have a calibrator yourself, consider to borrow one, or at least use this guide to do basic calibration. When calibrating your monitor, set your whitepoint to 6500K (most monitors have an option to choose a whitepoint). Calibrating your monitor is important to match your monitor gamma to a certain standard. For Windows based systems, this standard gamma is 2.2. When you have calibrated your monitor with a hardware calibrator, the accompanying software will create an ICC profile. This profile helps to output the right colors on your screen, when your screen is offered an image from the web or other applications. In fact it transforms the colors to correct for the error in your monitor. Summarizing the story above, after calibrating, you get closest to viewing content as it is meant to be.
Secondly, the virtual camera of your rendering application (in my case Vray but many others as well) has a linear response to light. In other words, its output has a gamma of 1.
If you are working in 3dsmax, the gamma correction is by default off. No gamma correction means basically that you are using a gamma of 1. Thus, by taking no action, 3dsmax assumes that you will view your output on a device which has a linear response behavior and that all material you work with has also a linear gamma! Since you have calibrated your monitor to work in a 2.2 gamma environment, the output of 3dsmax will look far too dark on your monitor. (as a side note, if you don't calibrate it will also look too dark, because you CRT monitor has its own gamma, which is about 2.5*)
To illustrate this, look what a gradient and 50% gray in a linear gamma looks like on a 2.2 gamma monitor(left) and compare it with the linearly interpreted image (right). In other words, when you display a linear image on a 2.2 gamma monitor without telling that it is linear, it is interpreted as gamma corrected, and therefore displayed to dark.
In other words, changing gamma influences the midtones of your image. A gamma >1 makes the midtones darker, a gamma <1 makes the midtones lighter.
Now you may think that you don't need gamma correction. That's probably because you have been using all sorts of tricks for years to get the desired result. (Tricks like adding linear falloff lights, or lights without decay, bright multipliers etc. etc.) All these tricks you have been using were to get a more realistic result, and without knowing, you were actually trying to correct for your monitors gamma!
Great, so far I understand it. I read somewhere that CCD's in digital cameras also have a linear gamma, but I never needed to correct them when viewing them on screen. Why is that then?
This question actually supports the idea why you should use gamma correction. When you take a picture with your digital camera, light is captured with a CCD (well, in most digital cameras it is). This CCD has in itself, a linear response curve, or in other words, a linear gamma. This raw linear data is then mapped to a different gamma (2.2) and colorspace, most likely sRGB or Adobe RGB. Professional image editing software that works with ICC profiles, can read the profile that is attached to your camera's picture, and can interpret it right to display the correct tones and colors on your monitor (if it is calibrated correctly!)
So how about pictures on the internet then?
Although the majority of internet users will never have calibrated their monitor or know anything about color management, cameras (and probably many internet publishing software packages) will do some basic correction without telling the user. As I mentioned earlier, a standard CRT monitor will probably be about gamma 2.5. Therefore it is advisable if you publish pictures which need to look correct for the majority of internet users, you convert your images for publishing to a gamma 2.5 profile (look for Native PC profile on that page).
Right. So to summarize, it's just about setting the display gamma in 3dsmax to 2.2 in order to display the linear rendering data correctly on my monitor?
That's true, but there is a little more to take care of. If you have paid attention and understand all concepts, you will know that there is a last step that has to be taken for making correct renderings: You need to correct your materials and textures. You will need to tell 3dsmax that the textures you use have already been gamma corrected. This can be done either globally or locally. Globally it can be assigned in gamma tab:
Don't worry about the dithered and solid gray squares, because they have nothing to do with accurate calibration.
Locally you can assign the bitmap a 2.2 gamma in the bitmap load dialog. Please take note of the fact that this rule only applies to textures that have been gamma corrected. In case you would make your own textures, it is of course better to keep them in linear space, and tell 3dsmax in the bitmap loader that it has a 1.0 gamma.
Finally let's look at the following figures. Figure 1 shows the old situation without colormapping. As you can see, you are offering Vray gamma space textures and colors, since you judge them based on what your monitor displays. In the end you are judging the linear rendering again on what your monitor displays and try to correct for it (by using the tricks mentioned earlier)
You can convert these files to work in linear space by turning on gamma correction, as shown in figure 2. Your materials (colors and texures) will look washed out. Therefore you correct the colors manually, or with the color correct plugin by Cuneyt Ozdas. The only thing you need to do is copy the old color to the color correct map, and apply a gamma correction of 2.2. Textures can be handled by turning on gamma correction for bitmaps as shown earlier.
In the most ideal situation (figure 3) you keep all your data linear and only correct the output to your display. The data is not touched, no gamma correction is burned in. Only in the very end, when publishing on internet for example, you will covert (a copy) to a non-linear profile.
O.K., enough theory I'd say. Can you show me some examples?
Sure. The following images were rendered using the described linear workflow.
I think it is about time that I start experimenting myself. Can I email you with questions regarding this technique?
Of course. You can always ask me questions by filling in the form on the contact page. Or post your questions in this thread on the vray support forum
If you are serious about color, I strongly advise you to calibrate your monitor. It is preferred to do it with hardware calibration (for example iOne from Gretag McBeth). You can abtain a reasonable result doing it manually - at least for CRT screens. If you work with LCD screens, manual callibration is hardly possible, because gamma is changing with the viewing angle. Basically the steps are as following:
First, make sure you have proper blackpoint setting and set your monitor to 6500K whitepoint. (for film you might need a different whitepoint setting like 5600K). Second, choose the appropriate gamma chart from AIM-dtp (although it principally sucks, I suggest you take gamma 2.2 as a calibration reference, since many textures, photos and stuff on internet as well as most pictures from consumer grade digital cameras are sRGB. Besides, not all image editors like Photoshop use ICC profiles when displaying images) Display the chart while adjusting the sliders in adobe gamma until the chart shows no colors and the gray bars appear to have the same luminance.
- the main page of AIM-dtp
- A guide for adjusting the blackpoint of your monitor.
- some gamma charts to evaluate your monitor
Sources:* Accurate Image Manipulation website by Timo Autiokari