Tone correction aware textures

The top render shows what can be obtained by applying a tone correction curve to a render. The lights and shadows are much more evenly distributed. There are no more hot spots for highlights and there are no more dark corners in the shadows. But all the colors and textures have faded out. The image lacks punch. The next step is to process the textures so we regain the colors, their contrast and some punch in the image.
In 3D CG, there are essentially 3 types of textures. There are painted textures taking the form of color maps stored in image files, there are procedural textures that are defined by specifying a set of color values and ways to combine them into patterns and there are measured BRDF type of texture data. I will only review preparation of color maps and procedural textures since BRDF textures are already measured and supplied in linear data space and are never tone corrected.
Painting and modifying photos for tone corrected 3D CG texturing
Now that the workstation monitor is set to gamma 2.2 and the paint application have its color setting for 3D texturing, here are the steps for making textures from a photo.
Load the photo in the paint application. The photo will appear too bright and washed out. That is actually how the renderer sees the photo. In the illustration to the right, the texture photo would normally appear like the left side but the renderer will see it like the right side. By using the "3D texturing" color setting, we can finally see the texture the same way the renderer see it and we can modify the texture so the renderer will actually see what we have in mind instead of a bland copy of what we have in mind.
Change the color mode to 16 bits. This will ensure that the color manipulation operations that will follow, will keep as much of the original color information as possible.
Apply a gamma correction of 0.45 to bring the colors back to something more natural. This modifies the color data in the file. The result of this operation is that, now, the relative color values better represent the reflectances of the photographed surfaces. In other words, you are now painting in a linear color space instead of in a tone warped color space. Whatever you paint in this linear color space will represent reflectance as the renderer sees it instead of representing the perceived colors as humans see it. This is exactly what we want.
Paint and modify the photo to suit your purpose. Whatever the modification you make, if they are visually plausible, then they will also be physically plausible.
Save the resulting photo in a 16-bits file format if possible. This will ensure that all color data that you see on your monitor will also be available in the file. Saving in 8-bits file format will clip some color values.
Modifying procedural textures for tone corrected 3D CG texturing
Procedural textures go from very simple single diffuse color to very complex hierarchy of embedded colors intermixed by procedural combiners. Whatever the complexity, be it a single color ar a ton of embedded colors, each individual color must be selected with post tone correction in mind. Essentially, this means applying a gamma of 0.45 to the procedural colors. But unlike painted maps, making those corrections to procedural colors is not as simple as sliding a cursor. There are essentially two approaches.
The first approach is only possible is the 3D CG application allows the artist to specify some tone correction in the 3D workspace itself. Ideally, if the 3D CG application can use a sort of "Color Setting" and this affect both the preview renders as well as all the color selection swatches and dialog, then it is only a matter of visually selecting the suitable colors. Like when using a "3D Texturing" color setting, resulted in very washed out colors in the color maps, in paint application, a 3D CG application that would manage color space the same way would provide the same visual feedback.
If the 3D CG application only provide compensated render preview, then the adjustment of the procedural colors must be done by trial and errors, adjusting the colors sliders while watching the preview render update until the resultant colors are looking good.
The second approach is more systematic and requires the help of a script that can automate the process or at least, a spreadsheet application or at the very least, a calculator. The idea is to convert every color's red, green and blue values to their gamma 0.45 equivalent. So say a given color is RGB( 234, 123, 45 ), in normalized color (meaning dividing those values by 255 to obtain colors in a range between 0.0 and 1.0), we get RGB( 0.918, 0.482, 0.176 ). Raise those number to the power 2.2 which gives RGB( 0.828, 0,200, 0.022 ). Now, to get the RGB color back in the range between 0 and 255, we just need to multiply those compensated values by 255 to get RGB( 211, 51, 6 ).
Staying within the range of plausible reflectance values
Since, with the "3D texturing" work environment, we are now working with reflectance instead of with colors, we need to make sure the reflectance colors we get at the end of the texture color compensation process, are physically plausible. One very important issue to understand about reflectance, is that there are no material in the real world that can reflect 100% of the light it receives and there are no material in the real world that can absorb 100% of the light it receives. The consequences of that for 3D CG artist is that no color can have 0 or 255 values in any of their red, green or blue channels. Not even near those values.
A very usefull reference in this matter is the Getag/Macbeth color checker commonly used by professional photographers. This color checker have been measured in all imaginable ways and the colors have been published and tweaked in numerous ways. Its spectral reflectance data and the CIE chromaticity coordinates have been published in Principles of Digital Image Synthesis by Andrew Glassner.
Well, taking this color checker as a basis, the black swatch, which is the most absorbent color in this checker, still reflects 3% of the light it receives and the white swatch, which is the most reflective color of this checker, only reflects 90% of the light it receives. In RGB values, this means that no color RGB component should have a value lower than 8 or higher than 230, artistic licence excepted. There exist materials that have reflectance greater than 90% or lower than 3% but they are generally not used on day to day objects.
So, back to the procedural color example above, the resulting compensation produced RGB( 211, 51, 6 ) and blue have value 6 which is just below the lowest acceptable value of 8. I could bring the blue value up to 8 but that would break the relationship between the red, green and blue values and change the color. I could also figure a formula to correct red and green values proportionately but I decided for a more ad-hoc method. I just bring the total range of all my colors between 8 and 230.
For bitmaps, I use the "Levels" dialog and I slide the first Output Level to 8 and the second output level to 230.
My rationale for this is that we accept as a practical theory that black have a reflectance of 3% and white have a reflectance of 90%. So when we see black on the screen or white on the screen, they should actually be converted to those reflectance values. And all the other colors that we also see on the screen should also be translated to the intermediary reflectance values. So whatever the colors we see on the screen, if they look well balanced between black and white, then in reflectance data, they should be output within those limits.
For procedural colors, it is just a matter of applying another set of mathematical operations. So starting with the normalized RGB values that we obtained after raising the normalized values to power 2.2, which gave us RGB( 0.828, 0,200, 0.022 ), instead of multiplying by 255, lets multiply by 227 (227 = 235 - 8) to get RGB( 188, 45, 5 ) and then add 8 to get RGB( 196, 53, 13 ).
|