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

The color is brighter on Quest3? #527

Open
1165048017 opened this issue Jan 13, 2025 · 2 comments
Open

The color is brighter on Quest3? #527

1165048017 opened this issue Jan 13, 2025 · 2 comments
Labels
synced to gitlab Synchronized to OpenXR internal GitLab

Comments

@1165048017
Copy link

1165048017 commented Jan 13, 2025

It seems like that on Quest3, the app shows brighter color?

In Openxr Spec, SRGB is recommended:
https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#rendering-swapchain-image-management

And also, in Quest3 official sample code, SRGB color format is also used for rendering: https://github.com/meta-quest/Meta-OpenXR-SDK/blob/main/Samples/XrSamples/XrCompositor_NativeActivity/Src/XrCompositor_NativeActivity.c#L1842

I have also done some experiments, if I follow the instructions that Oculus sample shown to us, I can get desired colors on the screen. That is to say: if I program the glclear value as (0.5,0.5,0.5), the color on Quest3's screen is (127,127,127). It is equal to middle gray 255/2=127.5

But with OpenXR-SDK-Source, the color one the screen is (187,187,187), it is more like gamma correction is applied to (127,127,127).

【Note】While using sRGB in the code, we need to use GL(glDisable(GL_FRAMEBUFFER_SRGB_EXT)) as Quest has done:
https://github.com/meta-quest/Meta-OpenXR-SDK/blob/main/Samples/XrSamples/XrSceneModel/Src/SceneModelGl.cpp#L1089

From my point of view, the color should on the screen should be the same as what I wrote in the code, not gamma corrected.

@1165048017
Copy link
Author

1165048017 commented Jan 14, 2025

After doing some experiments, I can manage the color on the screen. Here is an example.

Use grey color to debug

Change the color of the boxes to grey (0.5,0.5,0.5) in https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/main/src/tests/hello_xr/geometry.h#L33

Default results

The default program on Quest3 will show (188,188,188) which is much brighter than (127,127,127).

What if we want to get (127,127,127) on Quest3 screen

GLES

Similar work like Quest3 official sample code
Add glDisable(GL_FRAMEBUFFER_SRGB_EXT) in this function https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/main/src/tests/hello_xr/graphicsplugin_opengles.cpp#L140

Then you will get (127,127,127) on Quest3 for Hello_xr-gles

Vulkan

Pay attention to vk format and vk color space. I have noticed that on my PC, only one combination can show (127,127,127) on my computer screen, that is RGB vk_format and SRGB vk_colorspace.

Following this, the only thing we need to do is to change the vkFormat to VK_FORMAT_R8G8B8A8_UNORM at: https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/main/src/tests/hello_xr/graphicsplugin_vulkan.cpp#L1007

As for SRGB color space, the swapchain color format already help us achieve this at https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/main/src/tests/hello_xr/graphicsplugin_vulkan.cpp#L1555

I don't know if it is correct, but I think if I write (0.5,0.5,0.5) in my program, I really hope the color on the screen shows me (127,127,127), not (188,188,188)

@1165048017 1165048017 changed the title The color format while rendering? The color is brighter on Quest3? Jan 15, 2025
@rpavlik-bot
Copy link
Collaborator

An issue (number 2433) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#2433 ), to facilitate working group processes.

This GitHub issue will continue to be the main site of discussion.

@rpavlik-bot rpavlik-bot added the synced to gitlab Synchronized to OpenXR internal GitLab label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
synced to gitlab Synchronized to OpenXR internal GitLab
Projects
None yet
Development

No branches or pull requests

2 participants