Jump to content
  • Advertisement
Sign in to follow this  
NathanRidley

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

This topic is 1428 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Edited by axefrog

Share this post


Link to post
Share on other sites
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

Edited by Xycaleth

Share this post


Link to post
Share on other sites

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

Edited by Chris_F

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!