HDR Display SDK App Guide
HDR Display SDK App Guide
At its heart, our HDRDisplay SDK app is an image viewer. It provides a way to take raw HDR data and
display it on regular or HDR displays. In doing so, it enables you to examine how data from your own
game works on an HDR display. As long as you can dump HDR data from your game and convert it
either to EXR or HDR files, this application will allow you to test what your game looks like with HDR.
General Operation
The HDRDisplay SDK application has a fairly wide array of settings. All of these are exposed directly
through a user interface driven by Ant Tweak Bar. As such, it should very much be considered a
programmer’s tool. Figure 2 shows the initial view that a user will see when starting the application. The
data in the upper right is the color presently under the cursor, so you can see what the input values
were. The panel in the upper left contains the main settings; it has a drop down to select between the
presently loaded images and a drop down to select among several tone mapping modes. Below the
main settings panel is the panel for the presently selected tone mapper. By default this is a shader-
driven implementation of the parameterized ACES tone mapper. Each tone mapper has its own
collection of settings. (or none at all) Finally, the bottom left corner contains a set of iconified panels
with other controls and settings.
Launching
Make HDR display your primary display. Optionally, go into the NVIDIA control panel and look at the
options for this display. You can likely select 10 or 12 bit output and YUV or RGB along with 4:4:4, 4:2:2,
or 4:2:0. The best options to use are RGB and as high a bit depth as possible. Launch the run_hdr.bat
batch file. The app should go full screen, and you will probably see some flashing or mode changing on
the display.
Testing HDR
In the settings panel at the upper left, select "Test Pattern" for the Texture, and select "Linear" for the
tone mapper. Now, open the iconified panel in the lower left corner of the screen labeled
"TestPatternParameters". For the pattern, select HDR check. If things are all working correctly, you'll see
a washed out version of the test pattern. If things aren't working correctly, you'll only see white. If you
only see white, consult the display manual. You might need to enable on option from the display's
controls, or you might need to use a particular HDMI port.
Examining an image
Select the image you want from the texture list on the Settings panel. Switch to the "Parameterized
ACES" tone mapper. Now, switch between the 1000 nit, 1000 nit sharpened, and SDR preset buttons.
You should see the image change as different options are selected.
-display – start on a different display than the primary (0, 1, 2, etc with 0 being primary)
Presently, only images in hdr format and OpenEXR format are accepted. DDS format support is expected
in future releases.
The <TAB> key toggles the display of the user interface, allowing less clutter when examining images.
Stages of Operation
The HDRDisplay application has a pretty simple four stage pipeline. First, it computes an exposure level
on the input image via a geometric mean using a compute shader. Next, it runs an "Input Transform"
pass which applies filtering and color transformations to the input image, including exposure adjustment
and some color grading operations. Next, the image is tone mapped in two different ways. Once using
the selected tone mapper, and once using a special "SplitScreen" tone map operator that uses ACES, but
defaults to an SDR reference level. Finally, the application runs a compositing pass to generate the
output. The composite pass enables side by side comparison of SDR and HDR on the same screen.
The exposure adjustment consists of two independent controls. First, there is the auto-exposure setting.
Enabling this rescales the image so that the geometric mean of its luminance is 0.18 (photographic
middle gray). Additionally, the exposure bias parameter scales the image by a number of photographic
stops to handle the concept of low or high key. Setting the bias to -1 has the impact of scaling every
pixel in the image by 0.5, and setting the bias to +1 has the impact of scaling every pixel in the image by
2.0. The sample images included in the binary download are all pre-exposed and work properly with the
default 0.5 stop bias.
Figure 2 - Results of boosting exposure levels. Left image is log luminance visualization and right image is tone mapped.
Finally, the input transformation pass has the ability to apply a simplified degree of color grading to
demonstrate how some of the color grading previously done on the output referred data can be moved
to scene referred data. The controls are fairly simplistic, and they are really only meant as a starting
point. There are two separate sets of color grading controls, which can be used simultaneously. They
differ in the color space used, one working in the ACES RGB space, and the other operating in the IPT
space where luminance and chromaticity are separated.
Tone Mappers
The drop down to select the active tone mapper can be seen in Figure 6. Whenever a new tone mapper
is selected, its parameter panel will pop open to display any applicable settings. Presently, five different
options are available as tone mapper choices.
The linear path is the simplest case. It provides what amounts to a pass-through capability. It has the
capability to rescale and apply an arbitrary gamma function.
Visualize Range
The visualize range tone mapper applies a false color ramp to log luminance to facilitate debugging of
input levels such as light source levels being out of sync with the light they cast. Cyan is mapped to
middle gray (0.18) with pure green representing two stops higher luminance or (0.72). Yellow, red,
magenta, and white continue this pattern with each being four times more luminous than the prior
level. With this scheme, anything colored white is 10 stops above middle gray or 1024 times more
luminous than 0.18. The same pattern holds with blue being two stops below middle gray and black
being two stops lower than blue.
Reinhard
This is a simple implementation of the Reinhard tone map operator. ( x/ (x +1) ) It serves as a
comparison since many have used it in the past. When the output mode is set to scRGB, the display
luminance setting allows you to adjust the peak brightness instead of simply relying on the standard 0-1
behavior. This allows you to see what happens tone map operator that isn't designed to deal with
variable output levels.
Parameterized ACES
The ACES tone mapper is the most complex, in that it has many options to cover the range of settings
covered by our parameterized implementation of ACES. Parameterized ACES means that we implement
the ACES algorithms, but instead of encoding a single output device transform in the shader, we feed it a
set of parameters that cover all of the standard ODTs. Beyond this, the controls actually allow the
implementation of non-standard ODTs as well
Presets
For simplicity, the ACES tone mapper controls have a bunch of preset buttons. Each button applies
settings for common scenarios. The settings are as follows:
1000 nit - matches the ACES 1000 nit ODT, but outputs with scRGB
1000 nit sharpened - similar to 1000 nit, but the input range is compressed to bring out stronger
highlights and produce richer shadows
SDR - matches the ACES ODT for standard definition displays (what you want when not running
on an HDR monitor)
EDR - Settings appropriate for an enhanced dynamic range display (300+ nits and 10 bit color)
The display should be turned to full brightness. This enables a limited HDR effect on high end
monitors already in distribution
Extreme EDR - Settings appropriate for an HDR display that doesn't handle the standard HR
encodings, and expects data encoded similar to sRGB
Color Space
Color space sets up the output color space for the image. It is important to understand that the function
of this control changes somewhat depending on the selected EOTF mode control described below. For
all modes except scRGB, the output is in the color space selected. Changing from sRGB to BT 2020 will
show the image get substantially desaturated. This is because it is outputting colro as if it is expecting
the display to directly take BT 2020. Since the code is trying to output the same absolute color no matter
which space you chose, choosing a wider color space means that the colors will appear more
desaturated. For more information on color spaces, please see our HDR white paper and blog posts.
When not using the scRGB mode, you almost always want sRGB. When the output mode is scRGB, the
actual output color values don't change. This is because scRGB specifies absolute color rather than
relative color. What changes is where the colors are clipped to. If sRGB is selected, it will ensure that no
colors more saturated than the sRGB primaries are produced.
EOTF Mode
EOTF stands for Electro-Optical Transfer Function. You should think of this as the modern “gamma”. This
setting controls how the data is encoded before being passed to the display driver. In standard ACES, the
EOTF is baked into each ODT. In our parameterized implementation, several EOTFs are selectable. The
data flowing to the EOTF is in the intended output nit level. The selected EOTF remaps it to a mode that
matches what the display or driver expects. In sRGB mode, this means mapping the entire supported
range to [0,1], then applying the sRGB transform. Figure 10 shows the result of doing this to data that
has been tone mapped for a 1000 nit display. Obviously, the overall range is much larger, so the image
looks dark when displayed on a regular display. (Also, displays aren’t generally setup to display HDR data
with this type of encoding.) Additionally, there is a ‘virtual’ EOTF mode supported labeled as scRGB. This
is what the driver expects for an HDR signal. It is a virtual EOTF in that no display takes this encoding. It
is merely a representation that the OS or display driver converts to the proper EOTF for the display.
Figure 11 shows the same 1000 nit tone map output with the scRGB EOTF. It appears much brighter, and
the brightest parts of the image all appear clipped. This is because scRGB maps values brighter than
standard sRGB white to values greater than 1.0. When displayed on an SDR monitor, all these values
clip.
Figure 9 - 1000 nit tone map with sRGB EOTF
Surround
The reference ACES shaders have a simple method to adjust for the brightness of the surrounding
environment. Since adapting to brighter environments changes the sensitivity of our eyes, they apply a
power function to adjust from their reference dark environment to a dim environment. (This same
adjustment also exists in related operations like color appearance models) In Figure 14 and Figure 15
you can see the impact of applying an adjustment level beyond the standard level ACES prescribes for
adjusting to dim. The 0.8 power function used here would be more appropriate for a pretty bright
viewing environment. The lower the power used, the more you cram the colors toward the bright end of
what the display can do. For instance a 0.8 will boost middle gray from 10 nits to 25 nits with the
reference ACES 1000 nit ODT.
Figure 14 - Adjusted for dark surround
Curve
The curve settings all apply to the sigmoid-like curve applied during the ODT. These are the heart of the
tone mapper, and the different ones provide the largest variance between target devices. We have a
handful of settings that controls the curve
Tone Curve
The tone curve control selects the base curve. As I mentioned above, we have implemented a solution
where the reference curves can be reshaped to conform to somewhat different conditions than the
reference. These tweak are all included in the other curve settings. While it is hard to show the
difference of HDR in an SDR document, the difference in the brighter regions of Figure 12 and Figure 13
should be apparent. The higher input level supported by the 1000 nit curve allows detail to be preserved
that otherwise would have just washed out. It is important to not that the control contains both
adjustable and reference versions of the curves. The reference versions all ignore the other curve
settings, while the adjustable ones all take them into account.
Max Level
This is the parameter that controls the maximum output luminance. -1 has the special value that it uses
the curve's native value. It is probably fairly obvious that the native values for 1000 nit, 2000 nit, and
4000 nit are 100, 2000, and 4000.
LUT ACES
This is the operator I'd recommend to most game developers. It is an implementation of the same ACES
capabilities, but with the data all baked into a 3D LUT, so that the pixel shader consists of little more
than a single texture fetch. In addition to all the capabilities discussed above for the generic ACES
tone mapper, there are two additional properties. First, you can adjust the LUT dimensions. Second, you
can select what is called a shaper function. This function controls how the range of the input data is
mapped into the [0-1] space of the LUT. Since human vision is highly non-linear, a linear mapping of
values into the LUT does not make for an efficient representation. Further encoding of the values stored
in the LUT can potentially even further reduce the error over what is demonstrated here.
I think you'll find that this simple LUT-based approach produces results that are nearly indistinguishable
from the full ALU-driven approach, with a very low amount of GPU cost.
Split Screen
The "Split Screen" control panel provides yet another set of ACES tone mapping controls. However, this
set is always run, and it generates the alternate image for the compositing pass. This allows you to
compare different tone map implementations and settings side by side. By default, this panel is setup to
produce an LDR tone mapped image, allowing you to see ACES tone mapped for LDR and HDR side by
side. Since it is impossible to completely reproduce the exact same image displayed when the display is
in SDR and HDR mode, you may notice some difference. The biggest difference is that HDR mode
specifies all of its values with an absolute luminance level, and SDR has everything as a relative
luminance level. This means that when you output in SDR, you are more tied to the brightness settings
on the display. To help compensate for this, we have added a "post scale factor" to the panel. By
default, the SDR output will be at the reference 80 nits. Setting it to 2x will give you output at 160 nits
maximum luminance. Other settings like contrast boost or things like "vivid" mode are harder to account
for. In general, I have taken the position that most content developers are looking for a faithful
representation on the display, and modes like vivid are expressly not doing that. In general, SDR
displayed in split screen with HDR content is mostly akin to normal or cinema mode with brightness and
contrast set to 50%. This seems to be roughly the "no enhancement" settings for UHD TVs these days.
Composite
The composite control panel controls how the selected tone mapper and the alternate or "Split Screen"
tone mapper are composited together. By default, the primary tone mapper (labeled HDR) is displayed
in full screen. You can also split the screen vertically or tile it to see the second tone mapper (labeled
LDR) for simultaneous comparison.
Test Pattern
In addition to the loaded images, the SDK app has a simple pattern generator. The patterns and colors
are based on the photographic color checkers you may be familiar with. The test pattern can be
accessed through the drop-down list of images in the main settings panel.
The controls allow you to select a couple different test patterns as well as adjust the brightness of the
test pattern. The most important setting is probably the HDR test option. Selecting this option, and
selecting the Linear tone mapper provides a simple test to see whether your HDR display is working
correctly with the driver.
The HDR settings panel enables the HDR Display app to enable and disable sending metadata to the
display. When it is disabled, most UHD displays will behave like normal displays.
The parameters on the panel correspond to the mastering data sent to the display. The mastering
primaries for a game today will almost always be sRGB or possible DCI. The max master setting is the
maximum mastering luminance in nits. (brightest value the display you ‘mastered’ on could handle) The
min master setting is obviously the inverse of this, the darkest that black could be. The max CLL is the
maximum content luminance level. This is the maximum luminance level generated by the content. For
dynamic content like games, it probably makes sense to have the max master and CLL to be the same
thing, and them to match the maximum output level of the selected tone mapper. The max FALL is the
maximum frame average luminance level. This is how much the average luminance of an entire frame
should be expected to be. For all of these values, the UHDA mastering specs state that values of zero
means that the display should expect the default mastering levels, which are 1000 nits maximum
brightness and DCI primaries. So far, many UHD devices appear to be doing little with this data. We have
provided what appear to be fairly reasonable defaults for a 1000 nit display. (Maybe FALL should be a bit
higher) As firmware improves, we intend to update and improve this advice.