-
Notifications
You must be signed in to change notification settings - Fork 544
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
GL_FRAMEBUFFER_SRGB and Srgba8 vs Rgba8 render target #992
Comments
It is enabled by default. Our examples are mostly gamma correct, last time I checked. if caps.srgb_color_supported {
unsafe {
gl.Enable(gl::FRAMEBUFFER_SRGB);
}
} |
Ok, I've missed that bit. Should I switch to Srgba8 then? At a first glance, it does not make any difference (but perhaps I need to check twice). I'm also assuming this doesn't apply to FP16 render targets. |
Yes, that should do it.
|
Thanks :) |
I'm working on my toy project, for which I'm using a simple HDR pipeline. All the rendering and postprocessing is linear and I'm using FP16 render targets, until the tonemapping step, when I resolve the framebuffer to Rgba8.
At some point I realized I was missing the gamma conversion step - so I added it to my tone mapping shader.
When I got unexpected results, I guessed it was because the graphics driver was doing the conversion for me automatically. Digging deeper, it turns out it didn't but I could turn the feature on by rendering to a Srgba8 framebuffer.
I got the same results as Rgba8. Doing some investigation, I found that in order for OpenGL backend to to do so, GL_FRAMEBUFFER_SRGB must be enabled (together with setting the render target's format to Srgba8).
GL_FRAMEBUFFER_SRGB doesn't turn out from any search in gfx-rs. Is this a bug?
The text was updated successfully, but these errors were encountered: