Gamma 2.2 Setup or Linear Workflow: Before You Start
Gamma 2.2 Setup or Linear Workflow: Before You Start
Home Tutorials V-ray for 3ds Max tutorials Free - Gamma 2.2 setup / Linear workflow
On the left again the 1.0 method, clearly showing that there was way too much contrast in lighting and reflections. This
doesn't match with the lighing found in the original hdri map (middle).
On the right you can see that the reflection in the chrome ball is almost identical to the original hdri, and also lighting
is much more natural.
Take a look at the material editor and color swatches, how they got brighter. So if you want the same deep red for the
teapot in the new gamma 2.2 scene, you should also choose a deep red in the now corrected color selector.
In the V-ray virtual frame buffer, there is a tiny button which is pressed by default: sRGB button. This button applies a
gamma 2.2 curve to the VFB, so it displays your image as gamma 2.2 corrected, it doesn't actually burn the gamma
curve into the image.
Below you can see the effect of the button. When unpressed, it displays the image again without correction, so it looks
dark and wrong as before.
But this is where the problems start... The sRGB button applies a curve to display the image correctly. But is this the
exact same curve as 3dsMax applies while saving the image? The answer is NO! Altough the difference is small, it is
not 100% the same.
Hover your mouse over the image below to switch between the saved image with 3dsMax output = 2.2 and a
screenshot taken from the Vray frame buffer. As you can see, the saved image is a bit brighter overal, proving that the
sRGB curve is not the same as the 3dsMax gamma 2.2 curve.
Saving images from the virtual frame buffer - full float EXR
In a true linear workflow, you would also save your images as full float 32bit images, for example EXR. True linear
workflow means that you setup all your programs to correctly display these linear images. So your image never gets
the gamma or sRGB curve burned in, it is only displayed with such a curve in your software package (for example after
effects or photoshop).
When saving an EXR, the output gamma is also not burned in. However I found some mixed results in this regard.
Sometimes when I open a full float exr in photoshop it gets double corrected, sometimes it is displayed correctly.
In the case below, photoshop read the image correctly, and this time, it looked 100% identical as the screenshot from
the VFB inside 3dsMax. Hover over the image below to compare.
Gamma 2.2 setup without true linear workflow
What if you don't want to save your image in full float format all the time? A true linear workflow is usefull for people
who will use the full potential of these images to further post process them, for compositing needs etc...
Many people however will do just fine with a saved image where the gamma curve does get burned in while
rendering the image, so you don't have to worry about getting the exact same output gamma curve while saving the
image.
To achieve this, you need to go to one more setting in V-ray that controls this whole gamma thing: the color mapping
rollout.
You will need to switch on 'expert' mode to see all the settings. As you can see, the gamma is set correctly to 2.2.
But what about this 'mode' dropdown? By default, this is set to 'color mapping only (no gamma)'. This means that
no gamma curve gets burned in, the pixel values won't actually change while rendering. As we've seen, the image is
displayed correctly because of the sRGB button.
But if this gamma 2.2 isn't applied here, what does this mode do to our image? Well, if you would turn it off, by
choosing the 'none (don't apply anything)' mode, you will get an image that is almost identical... The only difference
is, that you will get slightly worse noise and GI quality.
Reason for this is that V-ray is doing all kinds of image sampling based on some algorythms that try to identify to what
extent more sampling is needed or not (to clear noise for example). When it is sampling very dark regions, it will stop
sampling quite early, as the noise isn't very obvious in these regions. But as we've seen, the actual image is quite dark,
it is just displayed brighter because of the sRGB button. So when you choose the 'none' mode, Vray is actually doing
it's sampling on a very dark image. If you choose the 'color mapping only' mode, it is doing its sampling on the
brighter image, but only the sampling, the gamma will not be applied to the actual pixels.
So, the only remaining mode 'color mapping and gamma' is doing both: it does the sampling on the bright image,
AND it burns in the gamma curve. But as I said earlier, because the gamma is burned in, you need to disable the
sRGB button or else it will get double corrected.
But because now the gamma curve is burned in already inside vray, we need to set the output gamma of 3dsMax back
to 1.0, because otherwise it will apply its gamma curve AGAIN while saving out the image, and it will get double
corrected.
Here's an overview of the settings you should use if you want to burn in gamma while rendering:
To make it a bit more complicated, here's a comparison between the image with the gamma burned in, and the saved
EXR where no gamma was burned in. As you can see, this burned in gamma also looks a bit brighter.
Conclusion is that the sRGB curve is not the same as a gamma 2.2 curve. But in the case of gamma burned through
color mapping, it doesn't matter, as you're never using the sRGB button. Your image viewed in the VFB will be exactly
the same as your saved image.
Summary
The linear workflow/gamma 2.2 setup now is the default workflow for V-ray and 3dsMax. All recent renderers by
the way use this approach. If you're new to Vray, you won't notice it that much, except when saving images to a non
full float format, as then the curve applied while saving is not the same as the curve applied while viewing the image in
the V-ray VFB, so you'll get slightly different looking images when saved.
The best solution, and the most professional one is to save out your images as EXR files. With these files, you'll also
have the most control for further color corrections or compositing. This way you're working in true linear space.
A second solution is to apply gamma 2.2 through color mapping, and to turn off the sRGB button and save out the
image without an extra gamma correction.
In my opinion, there is no right or wrong, use whatever method that suits you best!
One approach is to take a small part out of the logo image, save it as a texture and apply this small texture to the
diffuse channel of the material:
Or, place the texture in an empty slot of the material editor, double click it to open it up, and then in the teapot
material diffuse color swatch use the eyedropper to sample a color from this logo texture:
•
•
•
•