-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenGL: Unconditionally do glDisable(GL_FRAMEBUFFER_SRGB)
because we do our own sRGB conversion
#95433
OpenGL: Unconditionally do glDisable(GL_FRAMEBUFFER_SRGB)
because we do our own sRGB conversion
#95433
Conversation
…e do our own sRGB conversion
0c47c6a
to
dfcff4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
I can confirm this fixes #95313 I tested both on Quest native and with Quest Link.
And it's supposed to look like this PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this out by making a few changes/comparisons in the meta composition layer sample, looks good to me!
Thanks! |
Cherry-picked for 4.3.1. |
Fixes #95313
I think this is the right thing to do, because:
glEnable(GL_FRAMEBUFFER_SRGB)
on FBO's that have a color attachment which uses an sRGB internal format. So, it will do the conversion onGL_SRGB8_ALPHA8
, but not onGL_RGBA8
GL_SRGB8_ALPHA8
in OpenXR, because if we don't, the OpenXR compositor will assume the content is linear, and it'll do another linear to sRGB conversion. So, we're forced to use that as the internal format, in order to signal that we're giving it sRGB dataglDisable(GL_FRAMEBUFFER_SRGB)
unconditionally, because Godot's OpenGL renderer isn't even relying on that anyway (as explained above in my second point in this list)The main thing I'm not sure about, is if doing this inRasterizerGLES3::begin_frame()
is the right place to do it? We don't actually need to do it every frame, but I couldn't find an obvious central place to do it, It works fine inGLES3::Config::Config()
which only runs once, but we're only querying config there, not setting it, so it seemed inappropriate. I'd appreciate any advice about this!UPDATE: Moved to
RasterizerGLES3::RasterizerGLES3()
based on advice from Clay.This PR also partially reverts the changes from #74892, which did
glDisable(GL_FRAMEBUFFER_SRGB)
, but only when rendering viewports withuse_xr
set totrue
(which doesn't help the composition layers). With this PR doing it unconditionally, that is no longer necessary.