Oolite on HDR Displays
Moderators: winston, another_commander
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
Hmm... Other than the mention of the Microsoft Basic Display Adapter, which may or may not be relevant, I can't see what could be wrong here. HDR appears to be both supported (as expected) and enabled (which is what I wanted to be sure of, that it was enabled from Windows display settings). I'll see if I can make a build that would output more information during the HDR detection phase to see what IDs are generated for the primary monitor and try to pinpoint the exact point of failure, but I'm afraid that that will have to wait until the start of the next week.
I had already tested the build on two different PCs with HDR support without issues before publishing it. Hopefully we'll be able to track the problem in this case too.
I had already tested the build on two different PCs with HDR support without issues before publishing it. Hopefully we'll be able to track the problem in this case too.
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Oolite on HDR Displays
The Microsoft Basic Display Adapter is bound to Qemu's GTK window, which I keep available as a failsafe, but don't use at all, my login comes on the main NVidia display.
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
@Commander_X: Could you please try launching the test build with the second monitor also active, or, if this doesn't work either, with the second monitor physically disconnected? Just trying to confirm whether that particular monitor topology involving a disabled monitor has anything to do with the dialog always popping up.
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Oolite on HDR Displays
Did both tests and still the dialog showed up in each case. For the "physically disconnected" test, I actually checked in the settings, and there was no other monitor detected[*].another_commander wrote: ↑Sat Jan 14, 2023 10:12 am@Commander_X: Could you please try launching the test build with the second monitor also active, or, if this doesn't work either, with the second monitor physically disconnected? Just trying to confirm whether that particular monitor topology involving a disabled monitor has anything to do with the dialog always popping up.
*True from a Control Panel/Settings perspective, but otherwise a bit of a stretch: my device manager in turn shows 4 monitors usually, and it showed only 3 when I disconnected the second one. That is because there are 3 monitors connected to my graphics card (out of which 2 are used by Windows) and number 4 is Qemu's GTK window (again, not used by Windows, but still attached to the VM).
My 0.02 Cr is on the Microsoft Basic Display Adapter giving the lowest denominator.
Last second update: I disabled the Microsoft Basic Display Adapter from device manager and the dialog didn't show, so that seems to settle it.
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
As of commit 317ce1e, Oolite can now save HDR screenshots, so you can now immortalize your adventures in full HDR glory.
Pressing * will now save both a png and a Radiance .hdr format file when the game is running in HDR. Radiance .hdrs can be opened using a utility such as HDR + WCG Image Viewer.
We are using the stb_image_write header file for saving our .hdrs and the code is written in a way that will make it possible for Linux to save HDR snapshots too whenever HDR support gets added to it.
Pressing * will now save both a png and a Radiance .hdr format file when the game is running in HDR. Radiance .hdrs can be opened using a utility such as HDR + WCG Image Viewer.
We are using the stb_image_write header file for saving our .hdrs and the code is written in a way that will make it possible for Linux to save HDR snapshots too whenever HDR support gets added to it.
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Oolite on HDR Displays
A link for the updated version of the dev environment would also be needed. With LE20230121, it seems that winuser.h is missing some stuff:
Code: Select all
src/SDL/MyOpenGLView.m: In function '-[MyOpenGLView isOutputDisplayHDREnabled]':
src/SDL/MyOpenGLView.m:1049:2: error: unknown type name 'DISPLAYCONFIG_PATH_INFO'
src/SDL/MyOpenGLView.m:1050:2: error: unknown type name 'DISPLAYCONFIG_MODE_INFO'
src/SDL/MyOpenGLView.m:1051:17: error: 'QDC_ONLY_ACTIVE_PATHS' undeclared (first use in this function)
src/SDL/MyOpenGLView.m:1051:17: note: each undeclared identifier is reported only once for each function it appears in
src/SDL/MyOpenGLView.m:1051:41: error: 'QDC_VIRTUAL_MODE_AWARE' undeclared (first use in this function)
src/SDL/MyOpenGLView.m:1058:3: warning: implicit declaration of function 'GetDisplayConfigBufferSizes' [-Wimplicit-function-declaration]
src/SDL/MyOpenGLView.m:1067:21: error: 'DISPLAYCONFIG_PATH_INFO' undeclared (first use in this function)
src/SDL/MyOpenGLView.m:1067:46: error: expected expression before ')' token
src/SDL/MyOpenGLView.m:1074:21: error: 'DISPLAYCONFIG_MODE_INFO' undeclared (first use in this function)
src/SDL/MyOpenGLView.m:1074:46: error: expected expression before ')' token
src/SDL/MyOpenGLView.m:1084:3: warning: implicit declaration of function 'QueryDisplayConfig' [-Wimplicit-function-declaration]
src/SDL/MyOpenGLView.m:1120:28: error: 'path' undeclared (first use in this function)
src/SDL/MyOpenGLView.m:1122:3: error: unknown type name 'DISPLAYCONFIG_TARGET_DEVICE_NAME'
src/SDL/MyOpenGLView.m:1122:3: error: empty scalar initializer
src/SDL/MyOpenGLView.m:1122:3: error: (near initialization for 'targetName')
src/SDL/MyOpenGLView.m:1123:13: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1124:13: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1125:13: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1125:28: error: 'DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME' undeclared (first use in this function)
src/SDL/MyOpenGLView.m:1126:13: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1127:3: warning: implicit declaration of function 'DisplayConfigGetDeviceInfo' [-Wimplicit-function-declaration]
src/SDL/MyOpenGLView.m:1127:54: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1136:3: error: unknown type name 'DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO'
src/SDL/MyOpenGLView.m:1136:3: error: empty scalar initializer
src/SDL/MyOpenGLView.m:1136:3: error: (near initialization for 'advColorInfo')
src/SDL/MyOpenGLView.m:1137:15: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1137:30: error: 'DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO' undeclared (first use in this function)
src/SDL/MyOpenGLView.m:1138:15: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1139:15: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1140:15: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1142:56: error: request for member 'header' in something not a structure or union
src/SDL/MyOpenGLView.m:1164:51: error: request for member 'monitorDevicePath' in something not a structure or union
src/SDL/MyOpenGLView.m:1165:16: error: request for member 'advancedColorSupported' in something not a structure or union
src/SDL/MyOpenGLView.m:1165:55: error: request for member 'advancedColorEnabled' in something not a structure or union
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
Actually LE20230121 is OK and DISPLAYCONFIG_PATH_INFO for example is defined in wingdi.h line 2137. But it can be used only for Windows versions equal to or higher than 0x0601. Make sure you have -DWINVER=0x0601 in your GNUmakefile both for ADDITIONAL_CFLAGS and ADDITIONAL_OBJCFLAGS.Commander_X wrote: ↑Tue Apr 18, 2023 11:52 pmA link for the updated version of the dev environment would also be needed. With LE20230121, it seems that winuser.h is missing some stuff:Code: Select all
src/SDL/MyOpenGLView.m: In function '-[MyOpenGLView isOutputDisplayHDREnabled]': src/SDL/MyOpenGLView.m:1049:2: error: unknown type name 'DISPLAYCONFIG_PATH_INFO' src/SDL/MyOpenGLView.m:1050:2: error: unknown type name 'DISPLAYCONFIG_MODE_INFO' src/SDL/MyOpenGLView.m:1051:17: error: 'QDC_ONLY_ACTIVE_PATHS' undeclared (first use in this function) src/SDL/MyOpenGLView.m:1051:17: note: each undeclared identifier is reported only once for each function it appears in src/SDL/MyOpenGLView.m:1051:41: error: 'QDC_VIRTUAL_MODE_AWARE' undeclared (first use in this function) src/SDL/MyOpenGLView.m:1058:3: warning: implicit declaration of function 'GetDisplayConfigBufferSizes' [-Wimplicit-function-declaration] src/SDL/MyOpenGLView.m:1067:21: error: 'DISPLAYCONFIG_PATH_INFO' undeclared (first use in this function) src/SDL/MyOpenGLView.m:1067:46: error: expected expression before ')' token src/SDL/MyOpenGLView.m:1074:21: error: 'DISPLAYCONFIG_MODE_INFO' undeclared (first use in this function) src/SDL/MyOpenGLView.m:1074:46: error: expected expression before ')' token src/SDL/MyOpenGLView.m:1084:3: warning: implicit declaration of function 'QueryDisplayConfig' [-Wimplicit-function-declaration] src/SDL/MyOpenGLView.m:1120:28: error: 'path' undeclared (first use in this function) src/SDL/MyOpenGLView.m:1122:3: error: unknown type name 'DISPLAYCONFIG_TARGET_DEVICE_NAME' src/SDL/MyOpenGLView.m:1122:3: error: empty scalar initializer src/SDL/MyOpenGLView.m:1122:3: error: (near initialization for 'targetName') src/SDL/MyOpenGLView.m:1123:13: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1124:13: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1125:13: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1125:28: error: 'DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME' undeclared (first use in this function) src/SDL/MyOpenGLView.m:1126:13: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1127:3: warning: implicit declaration of function 'DisplayConfigGetDeviceInfo' [-Wimplicit-function-declaration] src/SDL/MyOpenGLView.m:1127:54: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1136:3: error: unknown type name 'DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO' src/SDL/MyOpenGLView.m:1136:3: error: empty scalar initializer src/SDL/MyOpenGLView.m:1136:3: error: (near initialization for 'advColorInfo') src/SDL/MyOpenGLView.m:1137:15: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1137:30: error: 'DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO' undeclared (first use in this function) src/SDL/MyOpenGLView.m:1138:15: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1139:15: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1140:15: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1142:56: error: request for member 'header' in something not a structure or union src/SDL/MyOpenGLView.m:1164:51: error: request for member 'monitorDevicePath' in something not a structure or union src/SDL/MyOpenGLView.m:1165:16: error: request for member 'advancedColorSupported' in something not a structure or union src/SDL/MyOpenGLView.m:1165:55: error: request for member 'advancedColorEnabled' in something not a structure or union
-
- ---- E L I T E ----
- Posts: 675
- Joined: Sat Aug 09, 2014 4:16 pm
Re: Oolite on HDR Displays
Yup, the options were there, it was only that 1) I didn't actually use LE20230121, but the previous LE20180425 2) I checked in LE20230121 for the QDC_ONLY missing, but in winuser.h (as google's first suggestion was)
All in order now, and I can confirm that the .hdr format is the one Blender can use (the main reason I looked after the announcement ).
All in order now, and I can confirm that the .hdr format is the one Blender can use (the main reason I looked after the announcement ).
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
Testing Oolite using Special K, Reshade and Lilium's HDR analysis shaders and visualizations. Looking good I think, highlights, black levels and shadow details look alright in the histograms. Unfortunately my display can output only around 400 nits.
As can be seen in the pics, a small percentage of the displayed colors (DCI-P3) is outside of the normal SDR colorspace (BT.709) and this is without boosting the saturation. The percentage can increase easily to 5% or more by simply raising the game's color saturation to 1.25. This means that when you play in HDR you can see more colors than typical monitors can display. We are using the full capabilities of HDR. Yay!
Oh, and the screenies above are SDR of course. Unfortunately you cannot see here exactly what I see on an HDR screen.
As can be seen in the pics, a small percentage of the displayed colors (DCI-P3) is outside of the normal SDR colorspace (BT.709) and this is without boosting the saturation. The percentage can increase easily to 5% or more by simply raising the game's color saturation to 1.25. This means that when you play in HDR you can see more colors than typical monitors can display. We are using the full capabilities of HDR. Yay!
Oh, and the screenies above are SDR of course. Unfortunately you cannot see here exactly what I see on an HDR screen.
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
Starting with revision 4dc9357, a new shortcut has been added to the Start menu group for the game under Windows. Those who use the trunk installers, will notice this new icon under the group "Oolite":
You can now use it to launch the game in HDR.
As a reminder, to be able to run the game in this mode you need:
You can now use it to launch the game in HDR.
As a reminder, to be able to run the game in this mode you need:
- Windows 10 or 11 (11 is strongly recommended).
- A monitor that supports HDR output.
- Graphics card that supports HDR, like 10xx NVidia series or higher spec.
- HDMI 2.1 / DisplayPort 1.4 or higher spec cable, so that the HDR bandwidth requirement is satisfied.
- Enabling of HDR in Windows from the Settings -> System -> Display
If your system does not support HDR for whatever reason you will not have the option to enable it as seen. - Execution of the game using the new shortcut or the -hdr parameter from Start -> Run or command line.
- hiran
- Theorethicist
- Posts: 2397
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Oolite on HDR Displays
Where could we store these instructions so players do not have to dig in some thread history to get this information? The wiki? The readme? Some other of Oolite's documents?another_commander wrote: ↑Sun Oct 22, 2023 7:04 pmStarting with revision 4dc9357, a new shortcut has been added to the Start menu group for the game under Windows. Those who use the trunk installers, will notice this new icon under the group "Oolite":
You can now use it to launch the game in HDR.
As a reminder, to be able to run the game in this mode you need:Attempting to launch the game without full HDR support will trigger a warning dialog informing the user that it was not possible to detect HDR on the system and asking whether the user would like to proceed with the game rendering as HDR in a non-suitable environment (i.e, looking weird) or abort.
- Windows 10 or 11 (11 is strongly recommended).
- A monitor that supports HDR output.
- Graphics card that supports HDR, like 10xx NVidia series or higher spec.
- HDMI 2.1 / DisplayPort 1.4 or higher spec cable, so that the HDR bandwidth requirement is satisfied.
- Enabling of HDR in Windows from the Settings -> System -> Display
If your system does not support HDR for whatever reason you will not have the option to enable it as seen.- Execution of the game using the new shortcut or the -hdr parameter from Start -> Run or command line.
Sunshine - Moonlight - Good Times - Oolite
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
I guess both the readme distributed with the game and the wiki are good places to have this information available.
- hiran
- Theorethicist
- Posts: 2397
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Oolite on HDR Displays
Every time again, after seeing new HDR images or advertizements for new monitors/TV screens and being impressed by their detail, color contrast and whatsoever I have to think twice to realize that the stuff was presented to me by my own, already existing equipment...
Sunshine - Moonlight - Good Times - Oolite
-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
Gamut expansion has been implemented in commit 2cc41fc.
Now we can break free of the standard Rec709 (aka BT709) color space, which is the typical SDR colors we normally see on non-HDR monitors. To this moment, Oolite is using exclusively Rec709 colors, even when in HDR mode. But HDR means more colors, amongst other things. Now we have the ability to tap into these colors not normally seen in SDR monitors and enjoy a much better visual experience by taking advantage of bigger available color spaces like DCI-P3 and BT2020.
In the top screen you can see the various percentages of colorspaces present. Note also the colorspace analysis at bottom left, you can see reds, yellows, greens and purples exiting the small inner triangle which represents Rec709 and going into the expanded colorspaces Also, in the second screen (a special gamut analysis visualization) Rec709 colors appear as grayscale while the yellows represent the DCI-P3 colorspace.
Unfortunately, there is currently a catch: Our HDR screenshot format (Radiance), cannot capture colors beyond Rec709 and breaks the HDR screenshots when there are extended gamut colors present. For this reason the feature is disabled at this time. It works just fine though, if you want to enable it (and have an HDR monitor so that you can actually see the result the way it is meant to be) to see for yourself, you can uncomment the line
Now we can break free of the standard Rec709 (aka BT709) color space, which is the typical SDR colors we normally see on non-HDR monitors. To this moment, Oolite is using exclusively Rec709 colors, even when in HDR mode. But HDR means more colors, amongst other things. Now we have the ability to tap into these colors not normally seen in SDR monitors and enjoy a much better visual experience by taking advantage of bigger available color spaces like DCI-P3 and BT2020.
In the top screen you can see the various percentages of colorspaces present. Note also the colorspace analysis at bottom left, you can see reds, yellows, greens and purples exiting the small inner triangle which represents Rec709 and going into the expanded colorspaces Also, in the second screen (a special gamut analysis visualization) Rec709 colors appear as grayscale while the yellows represent the DCI-P3 colorspace.
Unfortunately, there is currently a catch: Our HDR screenshot format (Radiance), cannot capture colors beyond Rec709 and breaks the HDR screenshots when there are extended gamut colors present. For this reason the feature is disabled at this time. It works just fine though, if you want to enable it (and have an HDR monitor so that you can actually see the result the way it is meant to be) to see for yourself, you can uncomment the line
//result = expandGamut(result, 1.0);
in the oolite-final-hdr.fragment shader. We will have to consider to somehow get over the Radiance format issue, maybe HDR pngs could be an alternative format for HDR screenshots as they are known to work with all color values.-
- Quite Grand Sub-Admiral
- Posts: 6671
- Joined: Wed Feb 28, 2007 7:54 am
Re: Oolite on HDR Displays
The screenshot problem is fixed, thankfully it was much easier than I thought. This means that there are no more obstacles for enabling gamut expansion.
So, gamut expansion has been enabled for HDR in build ee8bc5c. Yay!
Edit: Note that the fix involves clamping the screenshot colors to Rec709. This means that what you see on the screen is actually prettier than what gets saved to disk. The ideal solution would be to switch to a different HDR screenshot format, but this will have to do for the time being; the screenshots still look great in HDR.
So, gamut expansion has been enabled for HDR in build ee8bc5c. Yay!
Edit: Note that the fix involves clamping the screenshot colors to Rec709. This means that what you see on the screen is actually prettier than what gets saved to disk. The ideal solution would be to switch to a different HDR screenshot format, but this will have to do for the time being; the screenshots still look great in HDR.