-
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
Inconsistent SRGB behavior between GL and DX11 #997
Comments
Thanks for filing the issue! I think what's going on is that GL context always gives us sRGB surface, so we simply shouldn't rely on it being consistent with what we ask. Instead, our GL backend should switch sRGB on optionally, depending on the init arguments, and the windowing backends should pass the proper value according to requested formats. |
@kvark Maybe you saw some of my earlier messages in the linked ticket. But I'm currently going insane with color space issues (again). I'm referring to the Compare to the linear and perceptual (gamma-correct) ramps in this article: http://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/#light-emission-vs-perceptual-brightness In the My question is what is the recommended way to get perceptually-correct rasterization from |
triaged: GL context handling of sRGB is sad, leaving open for a bit longer |
This is probably related to these:
At least then I'm not the only one... |
The gl/glutin backend uses an SRGB format for the default framebuffer regardless of whether
ColorFormat
isRgba8
(like in the examples) orSrgba8
. The dx11/dxgi backend, on the other hand, only uses an SRGB format for its RenderTargetView ifColorFormat
isSrgba8
, notRgba8
.The gl backend's behavior is an okay default, since typically the OS compositor accepts a linear format but treats it as SRGB-like; though I'm not sure why glutin is going with SRGB since gfx looks like it calls
with_srgb
properly. To convert the dx11 backend to the gl behavior,gfx_device_dx11::create
could override its format argument's channel type when creating its render target view.On the other hand, this behavior makes it impossible for applications to use a different color encoding- for example, the Oculus Rift SDK requires that the application output actually-linear data because it does its own gamma correction taking its display's precise characteristics into account.
The text was updated successfully, but these errors were encountered: