|
Using gamma correction in XSI 7.x |
|||
|
© 2009 Rob Wuijster aka XSIBase/Rork Introduction: First of all, I'm not going into the technical part of what gamma is about. There are some really good starter pages on what gamma correction is/does: - http://en.wikipedia.org/wiki/Gamma_correction - http://softimage.wiki.softimage.com/index.php/Gamma%2C_Linear_Color_Space_and_HDR (Although still valid, the color correction workflow discussed is a bit outdated with the new gamma settings in XSI 7) - http://www.xsi-blog.com/archives/133 Read these first if you're not clear on the subject, and come back and keep on reading ;-) But to make it a quick readup: - gamma is used to brighten an image on screen due to the technical issues revolving old CRT monitors and TV sets, - All rendering is done in linear space, - Color textures should have their gamma removed, bump, displacement maps, gradients and HDRI's not. And the best part of working in linear workflow is the way lights work. Now lights work with proper "reallife" falloff and changing intensity and falloff will behave as it should, not overshooting into bright area's. We've all seen the nice lighting with portal lights and a tonemapper applied to it. No more wash outs!! :-) Sigh.....Even more theory: So with some of the basic knowledge about gamma correction floating around in our heads we look at rendering. Simplifying the whole gamma thing down to two things for rendering, we can state we have images with gamma correction and images with no gamma correction applied. Gamma corrected images: Images with gamma correction are basically the ones embedded with sRGB, so that means more or less any image processed for viewing on a screen. In our case every image that is created in Photoshop or any other image editor, (basically) all images from the web, also all -processed- images coming from a digital camera, like .jpeg's, are gamma corrected. It more or less comes down to this, as soon as something has to be displayed on screen, it will be treated with some form of gamma correction due to the way how monitors work. Non gamma corrected images: There is a special kind of images that has no gamma correction applied to it (well... if it was created properly), and that is the .HDRI and the .EXR format for instance. Also due to their floating point nature, there's no gamma correction in the image itself, making it a -linear- image. Well this is all just very nice, but how do we apply all this to the new gamma corrections settings in XSI? If you look at it it's all very simple and elegant, just turn on the settings and be done with it. But it's good to see what's exctually happening so we understand it all in combination with the gamma theory discussed just a few lines earlier. With XSI started, there's a couple of places to look at. Open up the preferences panel, the places to go to are the "Display" and the "Rendering" menus. Note: There's also one setting in the Render Pass settings, but we'll leave that for last. So let's start with the "Rendering" Menu first: Selecting the "images" tab, we see a "Color Profile" option. There's a drop down option and a gamma slider. We notice the 2.2 value, this is because we're running XSI on a PC system where this is the default gamma value. ![]() Now have a look at the drop down menu. We have four options: - Automatic - Linear - sRGB - User Gamma So what does this all do? It will tell XSI/MR how to use the gamma inside the images, when rendering your scene. "Automatic" means XSI will try to read the header of the image when getting it into XSI, and XSI will adjust the gamma correction accordingly. So if your image is a sRGB image, it will 'strip' the gamma from it so it will be -linear- inside the MR renderer. "Linear" will tell XSI to treat the image as a linear file, so sRGB gamma will be ignored or in the case of an HDRI or EXR, it -will be- a linear file. "sRGB" will tell XSI to strip the gamma from the image, like in Automatic mode. Be carefull with bumps-, displacement and gradients as they should be set to linear. If you don't do this, the image will "wash out" and will not get you the result you're after. "User Gamma" will have you set your own gamma value, e.g. 1.8 like the Mac. It's better to not touch this unless you're really sure you want this to happen and have a specific workflow where this is needed. So what option is best? Basically "Automatic" would work in most cases. You'll import your images created in Photoshop, taken from the web or your camera, XSI will 'strip' the gamma if they are sRGB images and that part is done. Also HDRI/EXR images will be 'seen' as linear and be treated properly as well. There are some issues though, as some HDRI's come with gamma built in. WHAT!!! Yes, sometimes gamma is added to HDRI's. Sometimes XSI will get confused by this, so when your render looks odd, have a look at the image's gamma settings of the images used. |
|||
|
Now render a 'Preview', and again, with the gamma correction turned off it will end up very dark. Turning it on will result in an image that looks like the one we used. ![]() Note: Like I said before, the setting will only affect the Preview window for the passes, but it will not add the gamma correction to the rendered images when rendering the pass. |
|||
|
Turning on the gamma correction for the shaderballs will correct the images for instance in the Material Manager. Also all other places where examples or shaderballs are used are gamma corrected when this feature is turned on.
![]() |
|||
|
And the last option will turn on gamma correction in the UI. As this might not be directly visible in the colors, there's a small dotted line around the colorswatch to indicate there's gamma correction in order here. |
|||
| Gamma correction on Pass rendering: Like I said in the beginning, there's a setting that you can use to add gamma correction to the rendered output. This option is found in the Render Pass. All other setings discussed previously will only add gamma correction to the display, not the rendered and saved image. ![]() So in this case you can turn on the 'Apply Display Gamma Correction' when rendering your pass(es), so the rendered image will be gamma corrected when saved to disk. Some notes on this. When using this settings, it's best to render to 16 bit or float to overcome a nasty little bug that could add mattelines in the alpha when rendering to 8 bit files. This can give you issues when compositing later on. Also you more or less should leave this setting turned off, render to 16 bit or float, and gamma correct/CC/tonemap the whole thing in PS, Nuke, Shake, Fusion or whatever you're comfortable with and then render it back to a 8bit image or sequence. So... Once you go linear, you're not want to go back. Or something like that... ;-) |
|||
|
|
|||