Search Unity

Cross-platform HDR display support in Unity 2023

August 15, 2023 in Engine & platform | 10 min. read
Sample image/scene with HDR tone mapping applied
Sample image/scene with HDR tone mapping applied

Is this article helpful for you?

Thank you for your feedback!

Greetings from the Unity Graphics team. We’re glad to announce that as of Unity 2023.2.0a18 (and 2023.2 beta), the Unity Editor and Standalone Players now provide cross-platform support for HDR output and full compatibility with the Universal and High Definition Render Pipeline.

High dynamic range (HDR) displays are becoming increasingly available. They’re capable of reproducing images with higher peak brightness and a wider color gamut to achieve better contrast (highlights/shadows) and color saturation. This results in more realistic variations in luminance across scenes, increased surface detail, and improved depth perception.

HDR Gamut View: The larger triangle represents the Rec.2020 color space
HDR Gamut View: The larger triangle represents the Rec.2020 color space

Before we share more information on how to enable HDR display for your project, along with platform support and useful guidelines, let’s quickly review the concepts of HDR rendering and display.

HDR rendering and display

When HDR rendering is enabled, the camera renders the scene to a floating point framebuffer, allowing the render pipeline to store a larger range of color values and better preserve detail. Shader calculations like lighting and postprocessing are performed using more accurate values (compared to SDR rendering), which leads to more convincing and realistic results.

While HDR rendering has been the default workflow for years, a lack of HDR-enabled display limits the presentable image’s color depth to a maximum of 8 bit per channel. This limits the maximum number of colors a pixel can represent (16,777,216 different color values) and the maximum brightness range. HDR to SDR tone mapping is used to remap the color buffer’s HDR values into a low dynamic range and optionally apply gamma correction, before finally writing the results into the swap chain image for presentation.

Scrubbing: Applying HDR tone mapping (ACES mode)

Unity 2022.1 introduced HDR display support for the High Definition Render Pipeline (HDRP), when targeting desktop and console platforms. This works by setting the device-native color space when creating the swap chain, and using custom HDR tone mapping to remap the color buffer’s content into the display-native HDR range. HDR encoding is then applied as a final step before writing to the HDR swap chain image.

With HDR output enabled, the swap chain image format is set to enable a higher color depth (either 10 or 16 bits per channel). This allows each pixel to represent a much wider range of possible color values (roughly 68 billion different values) and features a greatly increased brightness range.

With the release of Unity 2023.2, the Unity Editor and Standalone Players now provide full HDR tone mapping and display support across all render pipelines and capable platforms.

Enabling HDR display in your project

You can find the new HDR display settings in your project’s Player Settings under Edit > Project Settings > Player > Other Settings:

  • Allow HDR Display Output
  • Use HDR Display Output

These settings will enable HDR output for Unity Standalone Players and the Editor when running on supported platforms.

Moving Editor capture of how to enable HDR Player settings

With HDR output enabled, you can optionally configure the Swap Chain Bit Depth to set a lower (10 bit per channel) or higher (16 bit per channel) preferred color depth for the presented image. Note: Not all devices support 16 bit buffer formats, and may fall back on 10 bit instead.

When using the Universal Render Pipeline (URP), ensure that the render pipeline assets in use are set to enable HDR rendering. Select the RP assets included in the project (usually found under the Assets > Settings folder), then navigate to the project inspector and enable Quality > HDR.

Enabling HDR display in the Unity Editor’s Player Settings
Enabling HDR display in the Unity Editor’s Player Settings

Lastly, ensure that HDR tone mapping is enabled by adding a Tonemapping component to the postprocessing volume affecting your cameras. When HDR output is enabled, the following Tonemapping settings should be driven by the display’s HDR capabilities:

  • Minimum supported brightness
  • Maximum supported brightness
  • Paper White value: This value represents the brightness of a paper-white surface represented on the display, which determines the display’s brightness overall

You can access the display’s HDR range and paper white value using a C# API.

HDR tone mapping settings accessed via volume overrides
HDR tone mapping settings accessed via volume overrides

For an optimal viewer experience, we recommend providing runtime control over these parameters via a designated HDR calibration interface. We will soon share a new HDR calibration sample project, which you can use as a reference implementation to get started.

For more detailed information on HDR tone mapping and output, please refer to the updated documentation for HDR output in URP and HDR output in HDRP.

Platform support

To utilize HDR output at runtime, the device must be connected to an HDR-capable display, and the GPU must have the necessary support for enabling an HDR swap chain and presentation.

HDR output is automatically disabled at runtime when running on incompatible devices. You can query whether HDR display is supported on the main display and whether HDR output is enabled using HDROutputSettings.available.

In addition to the existing desktop and console support available in Unity 2022, mobile support is introduced in Unity 2023.2 for the following platforms:

  • iOS players (iOS 16+, iPadOS 16+)
  • Android players using Vulkan and GLES (Android 9+, depending on device capabilities)

Some common mobile devices that provide HDR display support include iPhone X and newer, Samsung Galaxy S10 and newer, Galaxy Note 10 and newer, Galaxy Tab S6 and newer…

This release also introduces XR support for capable platforms. Please refer to the XR platform’s documentation to determine HDR display support.

Guidelines and limitations

HDR processing is applied in two steps: HDR tone mapping and encoding. Both of these steps are usually applied during the last postprocessing render pass.

The only exception is when injecting additional passes in URP, to be executed after postprocessing. In these cases, HDR encoding is applied separately in a “final blit” pass, which is always called at the end of the render pipeline.

Custom Overlay Passes injected in the RenderPassEvent.AfterRenderingPostProcessing event will require special handling for HDR output. If HDR output is active and postprocessing is enabled, the previous passes would have applied tone mapping and colorspace conversion. As a result, you’ll need to author your custom effects to work with the expected dynamic range and colorspace.

When using HDR output, we recommend enabling HDR rendering for all displayable cameras. You can still disable HDR rendering on a per camera basis, but you’ll need to ensure that there are no render passes executed after postprocessing or effects that insert passes after postprocessing. When using SDR rendering with HDR output, the following features are unsupported:

  • Upscaling
  • FXAA
  • HDR Debug Modes
  • Custom passes after postprocessing

On the 2D Renderer, ensure postprocessing is turned off if you intend to use SDR rendering with HDR output.

For more detailed information on the above limitations and guidelines, please refer to the official documentation:

Reach out

Please give the new HDR display support a try in your project, and let us know what you think.

Your feedback has been instrumental and helps us prioritize the most meaningful solutions. Check out our public roadmap to vote on features that best suit your needs. If there are additional changes you’d like to see, feel free to submit a feature request or contact the team directly.

If you liked this deep dive, watch for future technical breakdowns from Unity developers as part of the ongoing Tech from the Trenches series.

August 15, 2023 in Engine & platform | 10 min. read

Is this article helpful for you?

Thank you for your feedback!

Join a discussion on our Forums
Related Posts