In the world of VFX, accurate data is king; and maintaining that data fidelity throughout the workflow plays a crucial role in final image quality.
One of the main reasons for compositing in linear space is that color math (image algebra) requires a proper “vector space” (i.e. scene referred linear with NO negative color primaries) to maintain a proper and predictable photo-accurate response throughout the various filters, color adjustments, layer interactions, etc.
Notice I mentioned filtering. When mipmapping a texture, we are doing exactly that so we want to make sure our image is linear *before* processing it to ensure the result is correct. So, this means we could either have a linear source image and mipmap it -or- promote an 8bit map to 16bit half float, then linearize it (because 8bits doesn’t have enough room to hold a proper linear representation), and then mipmap it. Either option will work but mipmapping a display referred (gammad) image and then leaving it to the render to degamma on the fly, *at render time*, is too late — the damage can not be undone. Your rendering equation is only as good as your least accurate data.
We’ll use this display referred image with very fine black and white stripes as our diffuse source color map to demonstrate:
When the above image is mipmapped in linear space, the black and white lines average to 0.5 as soon as the image is scaled in half. Below, the first sub-image shows proper image algebra (please keep in mind, since the texture is now linear the image below has been gammad to display referred space to look correct on the web):
Conversely, when color maps are mipmapped outside of scene-referred linear space (i.e. the gamma is baked in, such as sRGB) bad image math ensues — the black and white lines should NOT average out to 0.21404:
*** EXTRA GOTCHA: To add insult to injury, when image math errors are present in the sub images of a mipmip, they often go unnoticed because the TOP level image appears correct! Only the sub-images show the traits of improper filtering.
- One quick way to confirm your mipmaps is to load your mipmapped texture in the OpenImageIO’s “iv” tool and cycle through the mipmap levels.