Support for gamma correction
Posted: Wed Oct 08, 2014 17:08
Here's a feature request: add support for gamma correction.
Problem: in this age and day, a lot of apps are creating their backbuffer as R8G8B8_UNORM_SRGB (or the equivalent in OGL) to use the hardware for final gamma correction, and all the render pipeline is in linear space. Unfortunately CEGUI doesn't take that into account, which means that all the images will appear too bright.
I got around this problem by creating a render target, rendering CEGUI into it, and then binding a pixel shader to do gamma correction manually once I blend the GUI on top of my main screen. Though this solves the gamma correction issues, it introduces some artifacts with transparent widgets, caused by the default color used to fill the RTT buffer ( in my case black, which means all blended widgets have a dark halo ).
I think this could be solved by adding a flag when loading images, which would indicate whether they should be gamma corrected or not. Is that something doable ?
Problem: in this age and day, a lot of apps are creating their backbuffer as R8G8B8_UNORM_SRGB (or the equivalent in OGL) to use the hardware for final gamma correction, and all the render pipeline is in linear space. Unfortunately CEGUI doesn't take that into account, which means that all the images will appear too bright.
I got around this problem by creating a render target, rendering CEGUI into it, and then binding a pixel shader to do gamma correction manually once I blend the GUI on top of my main screen. Though this solves the gamma correction issues, it introduces some artifacts with transparent widgets, caused by the default color used to fill the RTT buffer ( in my case black, which means all blended widgets have a dark halo ).
I think this could be solved by adding a flag when loading images, which would indicate whether they should be gamma corrected or not. Is that something doable ?