Note: This is an addendum to our Photoscanned Texture Creation Process - start there if you are interested in learning how to create your own PBR materials using photogrammetry.
When taking photos, there are many camera settings (and post settings) that determine the brightness and colors of the resulting image.
It's tempting to guess at the "correct" brightness like an ordinary photographer would, based on what you think it should look like, and similarly what a good white balance should be.
However human vision (and your monitor) is not perfect.
Remember the goal of texture scanning is to copy a surface from the real world and paste it into a 3D scene that you can render with. If you do anything by eye or guestimation, you will absolutely end up with a result that is not accurate.
For example, this is the concrete floor in our garage:
Based on my experience in the dimly lit room, this is about what I would say the texture should look like:
However because my experience is subjective, this is wrong. After calibration, the material actually looks like this:
Now that the material is color calibrated, it will appear correct in a 3D render under any lighting conditions, dim or not.
But how do we know this, and how do we fix it?
With a carefully crafted collection of colored quads, we can adjust our texture to match reality, and more importantly, achieve more realistic and consistent renders.
Gone are the errors of subjective interpretation. It doesn't matter if you are color blind or your monitor is wildly inaccurate. With objective measurements and calibration processes, we can correct almost any texture.
The way these color charts are meant to be used is to build a profile using their dedicated software and apply that profile to all your photos in the shoot. However, the color profiles built into our raw processing software are quite accurate out of the box (for our cameras at least), so there's little need to go all the way and build a profile.
Instead, we simply need to calibrate the exposure (which the dedicated calibration software will not do) and set the white balance.
Overall our workflow is to calibrate up-front with the raw files. You can also calibrate your final texture itself (as long as you haven't done any exposure or color tweaks, intentionally or not), but it's easier to do it when processing the raw files anyway.
Like anything in photogrammetry, if you put garbage in, you get garbage out.
Meaning it's absolutely critical to shoot the color chart in a way that is going to be accurate. There's little point in calibrating something if the reference you're using is different from the target data.
Cameras and raw processing software apply all sorts of fancy adjustments to make photos look pretty.
We don't want that, we want the raw unchanged photons as ugly as they come. We want the colors of the pixels in our photo to correspond directly to the energy of the light captured. In other words, we want linear images.
This is absolutely critical, as our single-point exposure calibration below relies on the images being fully linear.
To get this, the first step is to disable the default tone curve. In Adobe Lightroom this is not possible without using 3rd party tools to generate custom profiles, so we recommend using Raw Therapee or Darktable instead (both free and open source).
Next, we want to make sure our whites and greys are not slightly orange or blue due to the color of the lighting we shot them in, or the imperfections of your flash.
This can be done easily using the white balance picker on the second grey square:
Finally, the most important part, setting our white levels.
In RawTherapee, we can place static pickers on our image to constantly display the color values (in multiple areas at once even, but since we know our image is linear we only need one):
You can make these pick areas bigger and smaller by holding control and left/right clicking on them. The bigger the area, the better the average sample of the area to smooth out the noise. You'll find the sample area also changes as you zoom in and out of the image.
Then, we want to see these RGB values in a 0-255 range that we can match. To do this, just click a few times on this area of the navigator to toggle between the display modes:
OK then, now we're ready to adjust our exposure until the white level is correct… but what is “correct”?
This topic is a bit of a can of worms, and the main cause of revisions of this workflow.
In a nutshell, the white value we're aiming for is [244, 244, 241]
if you're shooting in natural light, or [235, 232, 226]
if you're shooting with a cross-polarized flash (i.e. accounting for the lack of a specular component). If you're interested in the proof and research into this topic, we recommend Martin Geupel's excellent articles on the subject.
As you can see, our values are far off initially. To adjust them, we can simply adjust the exposure compensation:
We're close, and honestly close enough, but if one of your channels is a bit further off you can go a step further and use the RGB curves section of the color tab in order to adjust each channel independently and achieve an even closer match:
Notice that if you pan around your image and zoom in and out, the sampled values change slightly due to the noise in the image. This is unavoidable, and a good reason not to spend too much time getting exact matching values. See the “It's never going to be perfect” section below if you're tempted to try.
The foundation of the color chart workflow is knowing what color those little squares are supposed to be. You'd think it would be easy to find this information, and you'd be right, however, what you'll find is conflicting sources with slightly different values.
Typically the values may vary by 1-5 on the 0-255 scale which is enough to make a noticeable difference in contrast. But if you're using an older reference, the values may be even further off.
X-rite changed the formula for their chart colors quite significantly around 2014, and these old values (now wrong for modern charts) are sometimes still proliferated across the web and even inside calibration tools.
We obtained noticeably different results when calibrating using supposedly the same chart preset in different software, so we reached out to Calibrite to receive a list of sRGB values for our chart, which you can download in the Calibration Toolkit linked above.
Be sure to confirm for yourself what the values for your chart are meant to be, and that your calibrated output is as close as possible.
But ultimately, in the real world perfection is unobtainable. Yes, you can theoretically create a perfect color profile such that the values match exactly with the chart reference...
Ultimately, color calibration is a rabbit hole you could go crazy in. When you start chasing perfection, you can easily do more harm than good if you don't fully understand and control all of the circumstances, which in reality is not possible.
Our mindset at Poly Haven is to make a decent effort that gets you 95% of the way there, and then spend the time we've saved by avoiding the rabbit hole to improve the material in other more significant ways.