alvr-org / ALVR

Stream VR games from your PC to your headset via Wi-Fi
MIT License
5.25k stars 473 forks source link

Extend color correction functionality #547

Open BrianMwit opened 3 years ago

BrianMwit commented 3 years ago

Please follow the general troubleshooting steps first:

If your issue is about games not working, please open an issue for every game and list the game in the title.

Bug reports:

I noticed that the color in Oculus Quest 1 looks different from what it is supposed to be in Desktop, especially in the darker blue-green color, found in VRChat loading screen or Beat Saber's blue. I took a few screenshots from the Desktop, compared to from the Quest which confirm the color difference. Brightness/saturation can be mitigated in color correction settings, but hue is also slightly warmer. Codec: H264 (nvenc) Color Correction: Disabled

The picked color value is the solid background minimally affected by compression artifact. alvr-desktop

The exact same color shift can also be seen when looking at a previous screenshot through SteamVR Desktop view, suggesting that the issue affect not just the game, but also the entire SteamVR UI. alvr2

Environement

What hardware do you have: Desktop PC - AMD Ryzen 5 3600, Nvidia RTX 2070, Realtek HD Audio; Oculus Quest 1 What version of ALVR and SteamVR have you tried: 15.1.0 Do you have the latest Windows updates?: Windows 10 20H2

zarik5 commented 3 years ago

Quest 1 and Quest 2 use different color spaces (because Q1 has an OLED panel and Q2 has an LCD panel). ALVR currently cannot handle both, so we optimized the colors for the Quest 2, which coincidentally corresponds to no color correction.

zarik5 commented 3 years ago

If you find a good color correction configuration you can share your session.json file so we can make a preset.

sctanf commented 3 years ago

Wouldn't this require more advanced color correction? (shifting hue, separate brightness, contrast, saturation, and gamma corrections for red, green, and blue)

BrianMwit commented 3 years ago

I don't think hue shift is easy to fix through current color correction options. Looking through Oculus docs, I don't see any mentions that Quest 2 color is managed differently from Quest 1. Sounds like their runtime manage hardware display difference for app developer.

I compiled variants of v15.1.0 client that set different color space options

These screenshots compares Desktop screenshot, Desktop OBS screen capture (image also pass through YUV conversion NVENC encode) and various OVR color space through Quest screenshot function. aligned

The relatively over-saturated Rec.2020 and the cooler white of Quest profile can be seen in the headset. Overall, Rec.709 looks closest to me, although the cyan color is still slightly too warm. Perhaps we can detect if the app is running on Quest 1 and set the color space to the most accurate one? I don't have a Quest 2 hardware to test what it looks like, however.

My ALVR settings for reference: https://user-images.githubusercontent.com/9075947/111698323-9be0b480-882e-11eb-9be6-1cc9957d2191.png

VirtualDesktop's color isn't accurate either. It also have another different set of value from the same shot.

orangpelupa commented 3 years ago

Color shift also happens in Quest 2. The color is warmer in ALVR than via Oculus Link.

But the shift is quite small so probably nobody notices it.

BrianMwit commented 3 years ago

I dumped out nvenc output via fpOut. The color in the video stream matches the SteamVR -> OBS window capture above. This suggests that the server is fine and any color reproduction error happens on the Quest.

out h264_snapshot_marked

BrianMwit commented 3 years ago

After muxing the dumped video stream to mp4, I tried playing that in Oculus Browser, Oculus Gallery, and DeoVR video player on the Quest itself. All of them results in the same color as ALVR release (Rec.2020). The same happen when looking at an image of the problematic VRChat-loading-cyan-blue color. Only in Oculus Link would look correct. Even VRChat native Quest version has a very close but slightly brighter/a tad warmer tone (although, different build of the game is not exactly comparable) Perhaps this color management applies systemwide and only Oculus Link get access to special low-level settings.

In which case I think we can:

zarik5 commented 3 years ago

If I remember correctly VRAPI_COLORSPACE wasn't doing much and the colors were still off. The better option would be to make a more powerful color correction step. Unfortunately there are a lot of other things that have the precedence, still we can keep the issue open to gauge the interest.