Rec.2020 & HDR

I’ve had the same problem, it doesn’t look like the engine, at least in editor mode, is outputting an HDR signal. It may be something that only works in a standalone game, since I know a requirement of HDR output in some games is that it’s in exclusive fullscreen mode.

You won’t see HDR unless very specific conditions are met. Because there’s been a lot of confusion in the past about “HDR” and it’s connotations with those aweful photographic techniques to make pictures look ridiculous, it needs to be established that HDR is more applicable to the consideration of High Dynamic Range image processing. Pivoting on the Linear colour pipeline where colour is physically reliable in it’s behaviour and will operate in a larger range than what the destination display can render there needs to be a tonemapping operation to bring those values into the colour space and range of the display. The UE4 4.15 update brings ACES Tone Mapping which, if I understand correctly, will tone map into a larger range (up to 1000 nits peak or 2000 depending on HDR support) if the conditions are met. Otherwise you’ll get a more familiar image to what we’re used to where the brightest value can only be 1,1,1 = White. HDR on the other hand can have very bright Reds, Greens and Blues ; think Neon or bright blue skies.

The LG OLED E6 will accept up to 1000 nit HDR (I think it can only display up to 800 in the 2016 year model) but the flagship Sony will accept the 2000 nits level.

A lot of 4k TVs accept HDR - and yes, a firmware update can unlock this. But depending on display technology and in the case of LCD, the method of backlighting the pixels, you may or may not get a great HDR experience. 4K is a requirement of HDR too, because the spec supports the wider colour gamuts, frame rates/bandwidth and meta data to enable HDR. It’ll be interesting to see if you can render at HD and pack it as 4k so it’s adaptable to different hardware.

Exciting stuff.

Matt Hermans

My TV has the technology to support it, but I don’t think it has the backlight or screen technology so while it says it can do HDR I think it’s just increasing the backlight and contrast rather than doing anything real-testing on PS4 Pro and Xbox One S it just doesn’t look different.
I’m curious about the new HDR PC monitors, might upgrade my current monitors

My TV (Samsung KS8000) and video card supports HDR, and I’ve had HDR work in Hitman on my PC, as well as every PS4 Pro game I’ve thrown at it with HDR. My Nvidia Control Panel settings are all configured correctly to work with HDR as well. Everything is there, in theory, Unreal just doesn’t work with it. I’ve tried every single combination of configurations for HDR mode in Unreal’s console commands, none of them look right. Something about the way it’s being done isn’t actually sending out an HDR signal, where usually my TV actually says if the signal is in HDR when the application launches.

Hi Daniel, wow does Hitman support HDR ?
I was reading the other day about Shadow Warrior 2 that’s supposed to be the first to support HDR on the PC. I remember Alien Isolation had “HDR” in the options - but it wasn’t what we’re talking about.

It’s a bummer it’s taking a while on PC but it’s happening.

I’m not 100% across the HDR PC monitors (I have my blinkers on since buying the Acer X34 fairly recently) but what I think I gathered was it’s nothing like OLED or the Full Array LED backlit LCD - I think it’s still fairly early HDR tech (sidelit LCD or so) Still all good things.

Matt Hermans

Yeah, it does. They didn’t do the best job with it, but it does actually support HDR displays.

It’s mostly taking a while on PC because Windows itself doesn’t support HDR, and I remember reading somewhere that in order for DirectX to output HDR it needs to be in exclusive fullscreen mode for some reason. It’s super early on in HDR’s life right now, we may not end up seeing proper HDR support until the actual HDR monitors like the ASUS PG27UQ comes out later this year.

Okay I checked out Hitman and fumbled around to get it working - the initial setup was weird - I had to enable Deep Colour on the TV before the Nvidia Control Panel would show up anything but the default 4:2:0 display mode. After changing that parameter I could get 444, 420 and RGB. Still the Hitman menu wouldn’t show HDR as an option I could turn on (greyed out) but hit Play and the HDR logo lit up. After that there was an option to tweak out my peak brightness. Jumped into the game and didn’t notice any significant dynamic range lol ! I’ll have to try harder.

But can anyone tell me how to enable HDR output in UE4.15 ?

Under the same configuration that worked above, I ran my 4.15 project out to the LG as an only monitor (so there’s no hunting to do) via the GTX 1080 on Windows 10 and ran the command lines -dx11 -setX 3840 - setY 2160 -fullscreen. It launched in and looked correct for SDR. Then ran r.hdr.enableoutput 1 (or something similar to) and the image went washed out as if I was looking at HDR in SDR - but NO metadata was sent to the TV to activate HDR handling. There’s a few other cvars but they just changed the image in seemingly useless ways.

The release notes were vague and there’s nothing documented. Does anyone know more about what it takes to actually activate HDR ?

Matt Hermans

Check NVIDIA Control Panel. In Change Resolution page there should be different color output modes.

Yeah, I encountered several problems with HDR and working from an engine at work as well. For example, there needs to be a handshake between the nvidia control panel, your game engine and the TV and for some reasons that thing can break on many different occasions.
I had problems for example when my gameview window on the TV was not forced to focused full screen. However, when I tried navigating the viewport on my main screen, the viewport on the TV got out of focus and thus HDR broke immediately.

My nvidia driver looks like this for the Samsung HDR screen and as long as that viewport is fullscreen and in focus I can have it working but I havent tried it in Unreal yet, but the driver setup should be the same
0c6cc45ef69f3d5b394af901899d7773112513e3.jpeg

Right now I’m just talking about other HDR sources like Xbox One S and PS4 Pro, there’s no big difference playing a UHD Blu-ray with HDR to playing it without it, or playing one of the games that has HDR support.

The Samsung TVs use HDR10, which is only 10 bit, not 12. You should set output color depth to 10bpc. Also, if you want to do 60 hz over HDMI with HDR, apparently you need to set output color format to YCbCr422. With those set, I’ve had success with some HDR games on PC, but it -may- support full RGB at 30 hz? Not entirely sure.

But yeah, the handshake seems to be the thing that’s broken about all this right now.

Interesting! I tried setting 10bit but there is no option for it when running on that Samsung TV. Only shows either 8 or 12. I switched to YCbCr422 for testing purpose so lets see what I get :wink:

Does anyone know how we’re going to figure out how to enable/work with this UE4 capability ?

Who’s responsible for the experimental HDR support ?

I’ll have to start pinging twitter accounts I think…

Here’s the scoop I worked out by reading the code.

r.FullScreenMode 0

r.HDR.EnableHDROutput 1

r.HDR.Display.OutputDevice 5

start with -fullscreen on the command line parameters.

You may or may not need your TV in YCbCr420 mode. It theoretically shouldn’t require it, but it might.

Hi Zelex, that’s not entirely correct but pretty close. You’re missing the color gamut setting, r.HDR.Display.ColorGamut, which means you’ll be getting a very bright Rec709 output right now which isn’t much use. You need to set the correct device and gamut to match your platform and display combination. If you review the cvars you can see which outputs are currently available or it’s fairly straight forward to create new combinations in the shader branches. :slight_smile:

If you take a look at UGameUserSettings::EnableHDRDisplayOutput you should get a clearer picture as you can easily toggle the platform-specific implementations automatically through the GameUsersSettings interface (available in Blueprints). The internal 4.15 release notes actually had a quick-start guide in there including all cvars and other common trouble-shooting tips (cables, tv config, nvidia control panel setup to fix banding, etc.), but it seems to have gone missing.

I’ll follow up and see if they can be amended or recovered, sorry for the guess work!

Is there any way to make it work currently in the editor, or is it in a standalone game only?

Hi guys and - Thanks so much for the reply. It was a lonely time stabbing away at it.
I’m away from town just now but I’ll try this out as soon as i’m back - hopefully the quickstart guide can find itself again.
I have an LG OLED E6 - do you know what gamut settings I should use there based on what Zelex has written (Thanks too Zelex)

I’m really looking forward to a lot of very specific work involving this new functionality.

Matt Hermans

One of the restrictions for D3D11 is exclusive fullscreen support only. Moving forward with D3D12 support in Windows 10 we’ll hopefully be extending our offering to allow individual viewports to enable HDR output (Part of the “creators” update) as this will be essential for HDR content creation. I believe the Mac implementation already allows this. The support-levels are somewhat out of our control but we’ll hopefully implement support wherever possible.

For a D3D11 app on an Nvidia or AMD device:
r.HDR.Display.OutputDevice 5 // 1000 nit scRGB
r.HDR.Display.ColorGamut 2 // Rec2020

The “default” combinations in the settings system are just those that seem to cover all bases right now, but it’s fine to mix devices and gamuts or even expose those to end-users to let them decide. Enabling HDR on the display is an isolated step, after that it’s mainly swapping out tonemapping shaders to encode the data in different ways. Again, if you take a look at the above mentioned function you can see the common combos we’re supporting in this experimental release.

It’s worth noting that only experimental Nvidia D3D11 support shipped in the 4.15 release. If you’re after AMD support it is in Github now, it’s a small change you could likely integrate if needed. I can’t comment on a timeline for other platforms/features just yet though.

As a note: If you’re running a project with an options menu or similar already running with the GameUserSettings system, you can use the enable HDR option on those blueprint nodes (or C-side calls). That should handle automatically booting into HDR based on previous saved settings and falling back when booting with the HDR display unplugged, etc. The cvars are there as a way to give more convenient testing and manual control if you want it. :slight_smile:

Yep, on Mac we can specify HDR for a specific CAMetalLayer regardless of whether it is fullscreen or windowed but this hasn’t been tested in the Editor so YMMV.

Does one need to use linear color texture sources to get the full Rec2020 color gamut?
Do they need to be graded to ACES?

Cheers