Hello,
I was trying to write linear color values to FBO with glEnable(GL_FRAMEBUFFER_SRGB) enabled, but conversion from linear -> SRGB space seems not working.
My test program was doing something like this:
1. Load some test texture with GL_SRGB8 format
2. Initialize FBO with texture with GL_SRGB8_ALPHA8 format
3. Bind that FBO
4. glEnable(GL_FRAMEBUFFER_SRGB)
5. render test texture to FBO
-> now FBO should contain very the same color values as input test texture (conversion SRGB -> linear of test texture during sampling, and then conversion linear -> SRGB during write to FBO).
6. glDisable(GL_FRAMEBUFFER_SRGB)
7. Unbind FBO and render FBO texture to back buffer.
I was expecting, that output color will be the same as input texture, but result is darker, that means, that conversion is not working. Strange is, that rendering that test GL_SRGB8 texture directly to the back buffer (no FBO) when GL_FRAMEBUFFER_SRGB was enabled is working (output is very the same as input texture).
I was trying to initialize FBO just as GL_RGBA8 format, but results were still dark.
So, I want to ask, shoud SRGB conversion work even for FBO buffers? (as I was reading the spec of that extension, it should work). Or is it just some driver bug? (I'm using AMD card), or did I overlook something?
Thanks.