Skip to content
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

Avoid needing to gamma correct for OpenXR #136

Open
Manishearth opened this issue Mar 12, 2020 · 7 comments
Open

Avoid needing to gamma correct for OpenXR #136

Manishearth opened this issue Mar 12, 2020 · 7 comments

Comments

@Manishearth
Copy link
Member

Currently when we ask openxr for a color format, it asks for BGRA+sRGB as the highest preference, and then just BGRA (DXGI_FORMAT_B8G8R8A8_UNORM) next. We select that, since that's the format our textures are in. Apparently this leads to OpenXR running gamma-correction.

Ideally we should be able to directly draw to the textures as BGRA+sRGB so that openXR doesn't have any additional work.

@Manishearth
Copy link
Member Author

cc @asajeffrey do you know where in the code we can get the surface to use sRGB?

@jdm
Copy link
Member

jdm commented Mar 12, 2020

The answer may be https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_gl_colorspace.txt, but the last time I tried modifying various places in surfman that create surfaces to include it, I just kept getting EGL errors.

@jdm
Copy link
Member

jdm commented Mar 12, 2020

Possibly the real answer is the EGL_GL_COLORSPACE parameter of https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglCreatePbufferSurface.xhtml. That being said, for openxr in immersive mode we use eglCreatePbufferFromClientBuffer which doesn't have any mention of SRGB (https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglCreatePbufferFromClientBuffer.xhtml), and that makes me suspect that we might not actually have any other changes?

@jdm
Copy link
Member

jdm commented Mar 12, 2020

@Manishearth
Copy link
Member Author

So if we just create it with sRGB on the openxr side we should be fine? I've been considering this and have a build right now for testing it, but I suspect it's not enough given what they said in Teams.

@jdm
Copy link
Member

jdm commented Mar 12, 2020

I think all of us are just guessing at this point :/

@asajeffrey
Copy link
Member

From talking with jgilbert, it seems that getting the xr render layer to be sRGB would require some spec work to allow the layer format to be specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants