With regards to texturing, what is "linear space" and "nonlinear space"?

Started by
2 comments, last by NathanRidley 9 years, 5 months ago

On page 164 of Real Time Rendering (3rd Edition) there is the following passage:

"For textures encoded in a nonlinear space (such as most color textures), ignoring gamma correction when filtering will modify the perceived brightness of the mipmap levels. As you get further away from the object and the uncorrected mipmaps get used, the object can look darker overall, and contrast and details can also be affected. For this reason, it is important to convert such textures into linear space, perform all mipmap filtering in that space, and convert the final results back into nonlinear space for storage."

It's entirely possible that linear and nonlinear space were described at some earlier point, but I'm damned if I can find where. Please feel free to enlighten me...

Advertisement

Obligatory reading: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html

Here's a brief overview of my understanding:

  1. Monitors have a gamma curve to their colour distribution
  2. Artists create textures by seeing the altered colours of the monitor.
  3. As a result, those texture colours are considered to be in nonlinear space (or gamma space)

That GPU Gems 3 chapter explains it better than I can so I'll leave it as that smile.png

They are talking about sRGB encoding. Ordinary images (as in photographs with 8 bits per component) are typically encoded in the sRGB color space. You cannot perform math with these values until you have first converted them to linear RGB color space. If you create a texture using a sRGB format (e.g. GL_SRGB8_ALPHA8 or DXGI_FORMAT_R8G8B8A8_UNORM_SRGB) then this conversion happens automatically when you sample the texture.

Some additional information: http://www.gamedev.net/topic/652795-clarifications-gamma-correction-srgb/#entry5127278

Cool, thanks!

This topic is closed to new replies.

Advertisement