Display on HDR600 display with Direct3D12
Continuing from the last issue, this is display-related.
As I mentioned last time, this display I recently bought supports HDR600.
Dell AW2724DM 27-inch Alienware Gaming Monitor
The following article and others are a good explanation of HDR600.
https://chimolog.co/bto-gaming-monitor-vesa-hdr/
The number 600 represents a brightness of 600 nits.(nit=cd/m2) A conventional SDR display is about 100 nits, which means that it can express a much brighter image.
Let’s check it with Direct3D12.
First, change the frame buffer format to 10-bit RGBA.
//#define FRAME_BUFFER_FORMAT (DXGI_FORMAT_R8G8B8A8_UNORM)
#define FRAME_BUFFER_FORMAT (DXGI_FORMAT_R10G10B10A2_UNORM)
This is used to create SwapChain and RTV.
swapChainDesc.Format = FRAME_BUFFER_FORMAT;
psoDesc.RTVFormats[0] = FRAME_BUFFER_FORMAT;
Others are used in this area.
UINT numModes = 0;
pOutput->GetDisplayModeList(FRAME_BUFFER_FORMAT, 0, &numModes, nullptr);
modeDesc.resize(numModes);
pOutput->GetDisplayModeList(FRAME_BUFFER_FORMAT, 0, &numModes, &modeDesc[0]);
swapChain->ResizeBuffers(FRAME_BUFFER_COUNT, width, height, FRAME_BUFFER_FORMAT, 0);
ImGui_ImplDX12_Init(pDevice, FRAME_BUFFER_COUNT,
FRAME_BUFFER_FORMAT, m_srvHeap.Get(),
m_srvHeap->GetCPUDescriptorHandleForHeapStart(),
m_srvHeap->GetGPUDescriptorHandleForHeapStart());
The frame buffer is now set for HDR.
Next, change the color space.
// Color Space
if (FRAME_BUFFER_FORMAT == DXGI_FORMAT_R10G10B10A2_UNORM)
{
swapChain->SetColorSpace1(DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020);
}
else
{
swapChain->SetColorSpace1(DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709);
}
At any rate, I think we can display this alone.
I switched DXGI_FORMAT_R8G8B8A8_UNORM to DXGI_FORMAT_R10G10B10A2_UNORM and ran an application that displays one triangle.
With DXGI_FORMAT_R10G10B10A2_UNORM, the white background on the HDR-enabled display is much brighter; on the non-HDR-enabled display it is darker, or rather the white color we have seen.
Here is a screen capture of DXGI_FORMAT_R10G10B10A2_UNORM.
Screen capture of DXGI_FORMAT_R8G8B8A8_UNORM.
The gradient of the triangles is different. (The imgui colors are also out of whack, but don’t let this bother you.) The gradation in the above image looks unnatural, maybe because it is not via tone map.
You can’t tell the difference in the white background. There was a clear difference in brightness when I looked at it with my eyes, but capturing the screen doesn’t convey that.
I think the difference in gradation is due to the difference in color space. I changed the color space to DXGI_FORMAT_R8G8B8A8_UNORM without changing the color space, and found the same gradation as DXGI_FORMAT_R10G10B10A2_UNORM.
The difference between 8-bit and 10-bit is whether the gradient has a maximum of 256 or 1024 steps, but I could not distinguish that much in this experiment. However, we were able to confirm that HDR was working in Direct3D12, so that is all for now.
To explain in detail, we need to talk about color space, tone map, gamma, and PBR, but it is quite difficult to know what is the correct display, so I would like to write about it someday. If you are interested, please ask Dr. ChatGPT.