{
 "id": "hdr-display-output-pq",
 "title": "HDR display output (PQ / BT.2100)",
 "aliases": [
  "HDR10 output",
  "PQ encoding",
  "ST 2084",
  "Rec.2100 PQ",
  "scRGB output"
 ],
 "domain": "post",
 "subdomain": "display encoding",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "desktop-gpu",
  "webgpu",
  "unity",
  "unreal",
  "godot"
 ],
 "year_introduced": 2014,
 "inputs": [
  "hdr-image"
 ],
 "outputs": [
  "hdr-image"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "Convert scene-linear HDR rendering to an absolute-luminance signal for HDR TVs and monitors: Rec.2020 primaries plus the PQ curve, with paper white, peak and UI levels managed deliberately.",
 "how_it_works": "HDR10 and Dolby Vision-class output encode luminance in absolute nits with the perceptual quantizer (PQ, SMPTE ST 2084): linear luminance divided by 10 000 nits goes through a fixed rational power function so that 10-bit code values are spaced to match the eye's contrast sensitivity from near black to 10 000 nits. A game or viewer first renders in scene-linear colour, tone maps to a target peak (the display's reported or user-calibrated maximum) while keeping mid-grey and diffuse white mapped to a chosen reference white level (commonly around 200 nits, ITU-R BT.2408), converts from the working gamut (Rec.709/P3) to Rec.2020 with a matrix, multiplies by the reference-white scale to get nits, applies the PQ inverse EOTF, and writes to a 10-bit or float swap chain flagged as HDR10 (ST 2084 + BT.2020) or as linear scRGB. Interface elements are composited at a separately tuned brightness. Metadata like MaxCLL may be passed along. SDR fallbacks reuse the same tonemapper with a lower peak.",
 "when_to_use": "Use it when shipping to HDR10 displays, consoles or OS compositors with HDR enabled; choose it for the encoding stage after tone mapping, not instead of it. Use `aces-tonemapping`, `agx-tonemapping` or `khronos-pbr-neutral` to compress the scene to the display's peak, `linear-color-workflow` for the upstream linear pipeline, and `lut-color-grading` for the creative look. Prefer plain sRGB output with `reinhard-tonemapping` or `hable-filmic-tonemapping` when the target is SDR, or scRGB float on Windows when the compositor handles encoding.",
 "cost": {
  "class": "cheap",
  "notes": "A per-pixel colour matrix and PQ curve in the final pass; the real work is calibration and tone mapping design."
 },
 "failure_modes": [
  "Washed-out or too-dark image when PQ is written to an SDR swap chain, or an sRGB image is sent flagged as HDR",
  "Banding in dark gradients when the framebuffer is 8-bit instead of 10-bit or float",
  "Eye-searing UI and bloom because paper-white scaling was not applied to overlays",
  "Highlight clipping or wrong tone when the tonemapper's peak does not match the display's reported peak",
  "Out-of-gamut colours turning negative after Rec.709 to Rec.2020 conversion and not clamped"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.5594/smpte.st2084.2014",
   "type": "paper",
   "title": "High Dynamic Range Electro-Optical Transfer Function of Mastering Reference Displays",
   "authors": [],
   "year": null,
   "venue": "IEEE",
   "url": "https://doi.org/10.5594/smpte.st2084.2014",
   "ids": {
    "doi": "10.5594/smpte.st2084.2014"
   },
   "license": null,
   "extra": {
    "csl_type": "standard"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.5594/smpte.st2084.2014",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.5594/smpte.st2084.2014",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.5594/smpte.st2084.2014",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.5594/smpte.st2084.2014",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.5594/smpte.st2084.2014",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "anonhigh"
  },
  {
   "role": "primary",
   "key": "url:https://www.itu.int/rec/R-REC-BT.2100",
   "type": "web",
   "title": "ITU-R BT.2100",
   "authors": [
    "ITU-R"
   ],
   "year": null,
   "venue": "itu.int",
   "url": "https://www.itu.int/rec/R-REC-BT.2100",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261113124127/https://www.itu.int/rec/R-REC-BT.2100",
     "timestamp": "20261113124127"
    },
    "page_title": "BT.2100�:�Image parameter values for high dynamic range television for use in production and international programme exchange",
    "host": "itu.int",
    "title_confirmed_by_page": false,
    "title_unconfirmed": true
   },
   "provenance": {
    "title": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://www.itu.int/rec/R-REC-BT.2100 → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://www.itu.int/rec/R-REC-BT.2100 → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.2222222222222222,
   "__bib": "itur2100"
  },
  {
   "role": "tutorial",
   "key": "url:https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range",
   "type": "tutorial",
   "title": "Using DirectX with High Dynamic Range displays and Advanced Color",
   "authors": [
    "Microsoft"
   ],
   "year": null,
   "venue": "learn.microsoft.com",
   "url": "https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20260918155152/https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range",
     "timestamp": "20260918155152"
    },
    "page_title": "Use DirectX with Advanced Color on high/standard dynamic range displays - Win32 apps",
    "host": "learn.microsoft.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.7777777777777778,
   "__bib": "microsoftusing"
  },
  {
   "role": "implementation",
   "key": "gh:microsoft/directx-graphics-samples",
   "type": "code",
   "title": "microsoft/DirectX-Graphics-Samples",
   "description": "This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.",
   "authors": [
    "microsoft"
   ],
   "year": 2015,
   "venue": "GitHub",
   "url": "https://github.com/microsoft/DirectX-Graphics-Samples",
   "ids": {
    "repo": "microsoft/DirectX-Graphics-Samples"
   },
   "license": "MIT",
   "extra": {
    "stars": 6889,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-10-28T19:05:33Z",
    "language": "C++",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/microsoft/DirectX-Graphics-Samples",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/microsoft/DirectX-Graphics-Samples",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/microsoft/DirectX-Graphics-Samples",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/microsoft/DirectX-Graphics-Samples",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/microsoft/DirectX-Graphics-Samples",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/microsoft/DirectX-Graphics-Samples",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "microsoft2015microsoft"
  }
 ],
 "presets": [
  {
   "id": "pq-curve-vs-sdr-gamma-plot",
   "title": "PQ inverse EOTF vs SDR gamma, log-nits plot",
   "runtime": "glsl-fragment",
   "params": {
    "m1": 0.1593017578125,
    "m2": 78.84375,
    "c1": 0.8359375,
    "c2": 18.8515625,
    "c3": 18.6875,
    "reference_white_nits": 203
   },
   "code": "// GLSL ES 3.0, Shadertoy-style. Plots signal value vs luminance (log axis, 0.01 .. 10000 nits):\n// cyan = PQ (SMPTE ST 2084) inverse EOTF, orange = SDR gamma 2.4 referenced to 100 nits (clips above 100).\nconst float M1 = 0.1593017578125;\nconst float M2 = 78.84375;\nconst float C1 = 0.8359375;\nconst float C2 = 18.8515625;\nconst float C3 = 18.6875;\nconst float REF_WHITE = 203.0;     // BT.2408 HDR reference white in nits\n\nfloat pqEncode(float nits) {\n  float y = clamp(nits / 10000.0, 0.0, 1.0);\n  float ym = pow(y, M1);\n  return pow((C1 + C2 * ym) / (1.0 + C3 * ym), M2);\n}\nfloat line(float d, float w) { return 1.0 - smoothstep(w, w * 1.8, d); }\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = fragCoord / iResolution.xy;\n  float lg = mix(-2.0, 4.0, uv.x);          // log10(nits)\n  float nits = pow(10.0, lg);\n  vec3 col = vec3(0.07, 0.08, 0.10);\n  // decade grid\n  float gx = abs(fract(lg + 0.5) - 0.5) / 6.0;\n  col += vec3(0.10) * line(gx, 0.0015);\n  float gy = abs(fract(uv.y * 10.0 + 0.5) - 0.5) / 10.0;\n  col += vec3(0.06) * line(gy, 0.0015);\n  // reference-white marker\n  float markerDist = abs(uv.x - (log(REF_WHITE) / log(10.0) + 2.0) / 6.0);\n  col += vec3(0.5, 0.5, 0.2) * line(markerDist, 0.002);\n  // curves: pixel distance in y to each curve\n  float pq = pqEncode(nits);\n  float sdr = pow(clamp(nits / 100.0, 0.0, 1.0), 1.0 / 2.4);\n  float pxy = 1.0 / iResolution.y;\n  col = mix(col, vec3(0.25, 0.85, 1.0), line(abs(uv.y - pq), 2.0 * pxy));\n  col = mix(col, vec3(1.0, 0.6, 0.2), line(abs(uv.y - sdr), 2.0 * pxy));\n  // filled gradient bar along the bottom showing PQ code value as grey\n  if (uv.y < 0.04) col = vec3(pq);\n  fragColor = vec4(col, 1.0);\n}\n",
   "basis": "0",
   "license_note": "written for this index; constants are those published in SMPTE ST 2084",
   "execution_fidelity": "faithful-pass",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "hdr-display-output-pq",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.1077,
      "std": 0.117,
      "unique_colors": 111
     },
     "image": "/specimens/pq-curve-vs-sdr-gamma-plot.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "aces-tonemapping",
  "agx-tonemapping",
  "khronos-pbr-neutral",
  "reinhard-tonemapping",
  "hable-filmic-tonemapping",
  "lut-color-grading",
  "auto-exposure-histogram",
  "linear-color-workflow",
  "oklab"
 ],
 "extends": [
  "linear-color-workflow"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "agx-tonemapping",
   "why": "The tonemapper compresses scene light to the display's peak before PQ encodes absolute luminance."
  },
  {
   "id": "auto-exposure-histogram",
   "why": "Exposure decides where scene mid-grey lands relative to the reference-white nit level before encoding."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/post/hdr-display-output-pq.json"
 },
 "solves": [
  "image looks washed out on an hdr monitor",
  "need to output hdr10 from my renderer",
  "highlights clip on hdr television despite high peak brightness",
  "ui is far too bright when hdr is enabled",
  "how to encode scene light values into nits for display"
 ],
 "authority": "",
 "url": "https://texelatlas.vercel.app/t/hdr-display-output-pq/",
 "execution_fidelity": "faithful-pass",
 "fidelity_label": "Faithful Pass",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 1.83,
  "tier": "feather",
  "p50_ms": 0.0602,
  "p95_ms": 0.0619,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "pq-curve-vs-sdr-gamma-plot",
  "execution_fidelity": "faithful-pass",
  "fidelity_label": "Faithful Pass",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 1.43,
   "tier": "feather",
   "p50_ms": 0.0227,
   "p95_ms": 0.0228,
   "speedup_x": 2.65,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1.17,
   "tier": "feather",
   "p50_ms": 0.0336,
   "p95_ms": 0.0336,
   "speedup_x": 1.79,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}