Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

SystemInfo.hdrDisplaySupportFlags

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static HDRDisplaySupportFlags hdrDisplaySupportFlags;

Description

Returns a bitwise combination of HDRDisplaySupportFlags describing the support for HDR displays on the system.

The flags describe what the current platform and graphics API implement. They don't describe the display that's currently connected. The value doesn't change when you attach or detach an HDR-capable monitor, and it's the same for every display on the system. Each graphics API sets the flags when it initializes, so a system with no HDR-capable monitor can still report HDRDisplaySupportFlags.Supported.

Use this property to decide whether to offer HDR options in an application. To find out whether HDR output is available on a specific display, use HDROutputSettings.available. To find out whether Unity currently renders to HDR, use HDROutputSettings.active.

using UnityEngine;

public class HDRDisplaySupportExample : MonoBehaviour { void Start() { // Reports what the platform and graphics API implement. // It doesn't reflect the display that's currently connected. HDRDisplaySupportFlags flags = SystemInfo.hdrDisplaySupportFlags; Debug.Log($"Platform HDR support: {flags}");

if ((flags & HDRDisplaySupportFlags.Supported) == 0) { Debug.Log("This platform doesn't support HDR output."); return; }

if ((flags & HDRDisplaySupportFlags.RuntimeSwitchable) != 0) Debug.Log("This platform can turn HDR output on and off at runtime.");

// Query the display itself to find out whether HDR is actually available. Debug.Log($"HDR available on the main display: {HDROutputSettings.main.available}"); } }