Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Official Cross Platform HDR Display Support in 2023.2

Discussion in 'General Graphics' started by dnach, Jun 15, 2023.

  1. dnach

    dnach

    Unity Technologies

    Joined:
    Mar 9, 2022
    Posts:
    84
    Greetings from the Graphics team!

    We are glad to announce that as of Unity 2023.2.0a18, the Unity Editor and Standalone Players now provide cross-platform support for HDR output, along with full compatibility with the Universal and High Definition Render Pipelines.

    High Dynamic Range (HDR) displays are becoming increasingly available, and are capable of reproducing images with higher peak brightness and wider color gamut, in order 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

    Before sharing 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 in Unity

    When enabling HDR Rendering, the camera will render the scene to a floating point framebuffer, allowing the render pipeline to store a larger range of color values and thus better preserve detail. Shader calculations, such as lighting and post processing, are performed using more accurate values (compared to SDR rendering), thus leading to more convincing and realistic results.

    While HDR rendering has been the default workflow for years, a lack of HDR-enabled display will limit the presentable image’s color depth to a maximum of 8 bit per channel, thus limiting the maximum number of colors a pixel can represent (maximum of 16,777,216 different color values) along with the maximum brightness range. As such, HDR->SDR tone mapping is used in order 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 swapchain image for presentation.


    Applying HDR tone mapping (ACES mode)
    Unity 2022.1 introduced HDR display support for the High Definition Rendering Pipeline, when targeting desktop and console platforms. This was followed by Universal Render Pipeline support for desktop and console platforms in 2022.2.

    HDR output works by setting the device native color space when creating the swapchain, and using custom HDR tone mapping in order 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 swapchain image.

    With HDR output enabled, the swapchain 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 1 or 68 billion different color values) and a greatly increased brightness range.

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

    Enabling HDR Display in your project

    The new HDR Display settings can be found in the 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, as well as the editor, when running on supported platforms.


    With HDR output enabled, you can optionally configure the "Swap Chain Bit Depth" in order 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, ensure that the Render Pipeline Assets in use are set to enable HDR rendering. Select the RP assets included in the project (generally found under the Assets > Settings folder), then navigate to the project inspector and enable Quality > HDR:


    Lastly, ensure that HDR tone mapping is enabled by adding a tonemapping component to post-processing volume affecting your cameras. When HDR output is enabled, the following tone mapping 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 the following C# API: https://docs.unity3d.com/2023.2/Documentation/ScriptReference/HDROutputSettings.html


    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 could be used as a reference implementation and help get you started.

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

    You can read more about various guidelines and limitations in the following blog post: https://blog.unity.com/engine-platform/cross-platform-hdr-display-support

    ------------------------------------------------------------------------------------

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

    Your feedback has been instrumental so far as it helps us prioritize the most meaningful solutions. Please check out our public roadmap to vote on the 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 in the graphics forum and in this thread.
     
    Last edited: Aug 29, 2023
    sacb0y, DevDunk, c0d3_m0nk3y and 4 others like this.
  2. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    779
    What is the correct method for toggling HDR at runtime?
     
  3. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    779
    Also, for anyone who happens upon this I created a HDR demo project to help people get familiar with what HDR is and how it works. Currently made on Unity 2022.3
    https://momoirosoft.itch.io/hdr-demo