Question

I've recently been reading up about sRGB conversion and some of the benefits that come with it. I read a very useful article in GPU Gems 3 which is now available for free which covers some automatic methods vs manual shader written methods. Here is the article:

https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch24.html

In what instance would it be beneficial to utilise manual conversions instead of automatic conversions? It seems to me that with the use of the GL_SRGB_EXT passed into glTexImage2D and the use of GL_EXT_framebuffer_sRGB would not necessitate any manual conversions?

Was it helpful?

Solution

Well, one reason is already presented in that article. If you assume a (wrong) gamma value of 2.0, you can calculate it with a sqrt, which may be faster then even the built in method that behind the screens does most likely something like pow(frag.rgb,1.0/2.2). Of course, if rendering to sRGB is implemented in hardware, this won't optimize anything.

Another reason could be that you want to do some calculations in the non-linear color space yourself. For example if you want to convert to something like Y'CbCr for image processing tasks.

Finally, maybe you can get a very exact value of the gamma of your output device via some query, then doing a manual convert may give a (probably almost unnoticeable) better quality.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top