LWJGL Forum

Programming => LWJGL Documentation => Topic started by: laserlars on October 10, 2013, 21:08:02

Title: .withSRGB(true) doesn't affect the rendering
Post by: laserlars on October 10, 2013, 21:08:02
Hi!

I've been doing some investigations and trying to understand why .withSRGB(true) doesn't give me different colors compare to when it's off.

         PixelFormat pixelFormat = new PixelFormat(8, 24, 0, config.getInt("Multisampling"));
         Display.create(pixelFormat.withSRGB(true), new ContextAttribs(2,1).withDebug(config.getBoolean("DebugMode")));

From what I understand it will use the: http://www.opengl.org/registry/specs/EXT/framebuffer_sRGB.txt extension. And that would been that all the fragments should be gamma adjusted (2.2)

But taking screenshots with it on and off gives the exact same results.

Any thoughts?

Br
Title: Re: .withSRGB(true) doesn't affect the rendering
Post by: spasi on October 10, 2013, 23:18:38
You also need to do a glEnable(GL_FRAMEBUFFER_SRGB) for sRGB conversion to become active. See issues 3) and 4) in the extension.
Title: Re: .withSRGB(true) doesn't affect the rendering
Post by: laserlars on October 11, 2013, 09:31:32
Ah excellent! Thanks! I will check it when I get home from work!

I've shuld have spotted that in the specs. But reading the specs are not always trivial :)