Reputation: 1491
I have created an OpenGL application using GLFW library. The default framebuffer supports SRGB:
glfwWindowHint(GLFW_SRGB_CAPABLE, 1);
After calling glEnable(GL_FRAMEBUFFER_SRGB)
I get a desired result on the screen when render a test texture.
Out of curiosity I have called glGetFramebufferAttachmentParameteriv
for the default framebuffer:
GLint encoding = 0;
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK_LEFT, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding);
The encoding variable equals GL_LINEAR (also for GL_FRONT_LEFT buffer). The documentation says that:
For a default framebuffer, color encoding is determined by the implementation.
but I have set SRGB encoding explicitly during window creation so the encoding variable should be equal to GL_SRGB. Could you explain how does it work ?
Upvotes: 1
Views: 1162
Reputation: 156
Does your system support the extensions like EXT_framebuffer_sRGB or ARB_framebuffer_sRGB?
You will need this for the sRGB default framebuffer.
Upvotes: 0