microsoft / microsoft/terminal

HDR: What if we supported colors beyond the mortal realm?

Open
#17,203 5 comments 4 reactions 0 assignees View on GitHub
Area-Rendering Issue-Feature Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

I think it'd be kind of funny if we supported scRGB with half-precision floats, just like what DWM uses for composition on HDR displays. That would allow us, either just for fun when defining colors in a theme, or maybe for dithering, to use fine grained floating point brightness values and chromaticity (color) values. That way we could finally ship an official "Barbie+" theme were all colors are pink but some are even pinker than the others. Here's what scRGB looks like, the white triangle is sRGB:

![ScRGB svg](https://github.com/microsoft/terminal/assets/2256941/34247a74-7044-4648-8760-c987ce8caa46)
([Source](https://en.wikipedia.org/wiki/File:ScRGB.svg))

This requires two changes:
* Make the renderer HDR aware. This would probably also require a HDR setting menu similar to those found in video games where, at a minimum, the paper white brightness can be configured.
All relevant documentation can be found here: https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range#setting-up-your-directx-swap-chain
* Get rid of `til::color` in most places inside WT as it's limited to sRGB. It's just fine for VT related code or code based around `COLORREF`, however. The settings model needs a color struct that can represent any arbitrary space and gamut in order to not be tied down to any particular representation. The render can then convert it losslessly to scRGB floats. This also avoids loss during blending.

Contributor guide

Open the contributing guide

Research direction

Start by mapping the renderer, settings model, and uses of til::color, then read the linked DirectX HDR swap-chain documentation. Define the scope for HDR-aware rendering, configurable paper-white brightness, and color values beyond sRGB; done means these two proposed changes are implemented without loss during blending.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.