Skip to content

[BUG] HDR breaks the 2D Tutorial starting from Chapter 4 #165

@dmonkman

Description

@dmonkman

At the end of Tutorial 4, I was getting a black window instead of Colors.CornflowerBlue as expected. After further investigation, I found that modifying the graphics settings (Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight or Graphics.IsFullScreen) with HDR enabled on my display is what causes the black window output. If I do not modify any of these settings (in other words, I comment out these three lines in the tutorial), the code seems to work even with HDR enabled. This bug also prevented content from being displayed in Tutorial 5. This seems like a major hinderance to new developers as there are no exceptions thrown, no console outputs to help them debug, and no discussions of this specific issue that I could find in the community.

Display information

DELL G3223Q
Display 1: Connected to AMD Radeon RX 6800 XT

Desktop mode: 3840 × 2160, 144 Hz
Active signal mode: 3840 × 2160, 144 Hz
Bit depth: 10-bit
Color format: RGB
Color space: High dynamic range (HDR)
HDR certification: Not found
Peak brightness: 530 nits

Device specifications

Processor: AMD Ryzen 7 5800X3D 8-Core Processor @ 3.40 GHz
Installed RAM: 32.0 GB
System type: 64-bit operating system, x64-based processor

Windows specifications

Edition: Windows 11 Pro
Version: 22H2
Installed on: 2023-08-10
OS build: 22621.4317
Experience: Windows Feature Experience Pack 1000.22700.1041.0

Possible Solutions

  1. Add a warning to Tutorial 4 informing users that HDR can break the expected window output in the 2D Tutorial. The code works properly if I disable HDR for my display:

Windows: System > Display > Use HDR > Off

  1. Add code that ensures (more) compatibility with HDR displays.

Images

Width and height are changed from defaults (HDR enabled) -> Larger black window

Image

Width and height are commented out (HDR enabled) -> Smaller properly colored window

Image

Width and height are changed from defaults (HDR disabled) -> Larger properly colored window

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions