Q2PRO-X

Q2PRO-X 1.6 Beta 5 by ly — HDR in Q2PRO-X 1.6 Beta 5

The complete guide in HTML. The original DOCX is available from its documentation card.

Q2PRO-X 1.6 Beta 5 by ly

HDR in Q2PRO-X 1.6 Beta 5

Q2PRO-X document image

Project author: ly

High dynamic range, tone mapping and screenshots

English edition • Q2PRO-X 1.6 Beta 5 by ly • 2026-10-10


Contents

The entries are links: click one to jump to that section.

HDR changes in beta 2

What HDR is in Q2PRO-X

Where the settings live

1. Quick setup

2. The main parameters

3. WGL and EGL

4. Gamma and compatibility with older configs

5. HDR presets in AVFX

6. Screenshots

7. Diagnostics

8. Common problems


HDR changes in beta 2

Fixed the black screen when switching WGL HDR output and hangs while loading or changing a map with AVFX enabled. An ordinary map change preserves the current HDR output mode without an intermediate disable/re-enable cycle. Failed mode changes have a rollback path. AVFX starts after the color mode is applied and the map is ready; SDR and other backends use the same lifecycle. Leaving a map releases its AVFX data, including blood and contact effects.

HDR rendering and HDR output remain separate settings. The display requirements and distinctions below still apply.


What HDR is in Q2PRO-X

HDR in Q2PRO-X is split into two independent parts.

The internal HDR renderer computes the scene in an extended range, then passes it through tone mapping, bloom and the final output.
True HDR output sends the extended signal to the display, when the graphics backend and the Windows output path allow it.

The internal HDR can be used without a true HDR display: it still improves how light and overbright values are handled. The full effect appears when both parts are enabled and the monitor really supports HDR.

The menu's own recommendation. Use the win32wgl backend for the best HDR effect. win32egl can output HDR too, but on Windows it depends on system HDR being enabled and has a separate white-level calibration.

Where the settings live

Menu path: Main menu → Video & Display → HDR Settings

HDR Settings

TypeSectionRowVariable or targetWhat it does
SectionRender & outputRender & output
ListRender & outputHDR renderinggl_hdrgl_hdr: HDR rendering mode. Off keeps the current LDR look. Applies immediately. [Off / Auto / Force]
ListRender & outputHDR display outputgl_hdr_outputReal HDR signal to the monitor (needs Windows HDR; applies instantly via video restart). Applies immediately. [Off / On]
ListRender & outputHDR output modegl_hdr_output_modePaper-white parity or real above-white highlights. Applies immediately. [Paper-white match / Extended highlights]
ListRender & outputScene formatgl_hdr_scene_formatHDR scene buffer format. Auto picks the best supported. Applies immediately. [Auto / RGBA16F / R11F_G11F_B10F / RGBA8]
ListRender & outputTone mappinggl_hdr_tonemapHow overbright light is compressed to the display. Applies immediately. [Linear / Reinhard / ACES / Uncharted]
SectionBrightnessBrightness
SliderBrightnessPeak brightnessgl_hdr_peak_nitsTarget display peak brightness. Applies immediately.
SliderBrightnessPaper whitegl_hdr_paper_white_nitsBrightness of ordinary white. Applies immediately.
SliderBrightnessEGL app whitegl_hdr_egl_app_white_maxWin32egl-only app-side white cap for true HDR output. Lower protects lamp/sun/moon detail from EGL overexposure; higher makes EGL HDR brighter. win32wgl ignores it. Applies immediately.
SliderBrightnessExposuregl_hdr_exposureManual scene brightness compensation in EV stops. Applies immediately.
SectionHDR bloomHDR bloom
SliderHDR bloomHDR bloom thresholdgl_hdr_bloom_threshold_nitsBloom onset in HDR units. Applies immediately.
SliderHDR bloomHDR bloom strengthgl_hdr_bloom_strengthHDR-aware bloom strength. Applies immediately.
SectionPeak scalesPeak scales
SliderPeak scalesEmissive peak scalegl_hdr_emissive_peak_scaleHDR peak of map / spawn emissive lights. Applies immediately.
SliderPeak scalesCelestial peak scalegl_hdr_celestial_peak_scaleSun/moon disk peak + celestial bloom. Applies immediately.
SliderPeak scalesFX peak scalegl_hdr_fx_peak_scaleHDR peak of lightning sky flash + AVFX lightning bloom. Applies immediately.
SectionServiceService
ListServiceHDR debug viewgl_hdr_debugHDR diagnostic overlay. Applies immediately. [Off / False-color / Histogram / Clip mask]
NavigationServiceHDR info...gl_hdr_infoPrint HDR capability / scene-format probe to the console.



1. Quick setup

1. Enable HDR for your monitor in the Windows settings.

2. In Q2PRO-X, select the win32wgl backend if you want the maximum effect and your driver is stable with WGL.

3. Load a map. Checking HDR output is more reliable after a map has loaded: part of the output path only becomes evident with real rendering.

4. Open Main menu → Video & Display → HDR Settings.

5. Set HDR rendering to Auto, HDR display output to on, and the output mode to extended highlights.

6. Set Paper white for a comfortable ordinary white: usually 160–250 nits.

7. Set Peak brightness for your monitor: 1000, 1300 or 1600 nits, for example.

8. Run gl_hdr_info and check that the backend, the scene format and the output path look as expected.

An example for a 1300-nit display:

vid_driver win32wgl

gl_hdr 1

gl_hdr_output 1

gl_hdr_output_mode 1

gl_hdr_paper_white_nits 200

gl_hdr_peak_nits 1300

gl_hdr_tonemap 2

gl_hdr_info

gl_hdr_output takes effect after a video-mode restart.


2. The main parameters

VariableAccepted valuesDescription
gl_hdr0=off / LDR (default) / 1=auto (HDR when supported) / 2=force (developer)Master switch for the optional HDR / tone-mapping render pipeline. Off keeps the accepted LDR look exactly. Auto enables HDR scene rendering when the backend can actually render to a floating-point scene buffer (probed at startup — see gl_hdr_info). Force is a developer setting that requests HDR even on marginal backends. HDR keeps light in linear high-range until a final tone-map to the display, so the sun, lightning, stars and emissive effects can exceed ordinary white before being compressed instead of clipping flat.
gl_hdr_output0=SDR tone-mapped (default) / 1=true HDR (live on active native WGL)True HDR display output (HDR-6B/HDRLIVE-1). 0 = SDR tone-mapped output. 1 = request a real FP16 scRGB presentation surface. On native win32wgl, changing this while a map or demo is active runs one bounded live transaction: retire the old renderer, settle Advanced Color on the captured monitor if needed, recreate once, then verify the first presented backbuffer. A failed gate or proof rolls back to readable SDR; Windows HDR is restored only when this game enabled it. The selected desktop-fullscreen margin policy is preserved across the transition. Startup, disconnected menus and loading stay on the regular surface. The established win32egl/ANGLE path still applies the change through its normal refresh. gl_hdr_info and gl_hdr_transition_info report requested versus actual state and the exact fallback. The app buffer uses linear scRGB units; Windows composition may additionally apply its SDR-reference-white scale. screenshotjxr is presentation-matched and screenshotjxr_raw is app-exact.
gl_hdr_output_mode0=paper-white parity (default) / 1=extended highlightsTrue-HDR output mapping mode (only acts on a live FP16 surface). 0 = paper-white parity: the picture matches the accepted SDR look anchored at gl_hdr_paper_white_nits (UI white == scene white == paper white; nothing exceeds it). 1 = extended highlights: the final clamp is lifted to peak/paper, so tone-curve values above 1.0 (sun/moon discs, lightning, dialed emissive peaks, exposure) survive as REAL above-paper-white brightness on the HDR display. UI is never boosted in either mode. scRGB mapping per spec: value = nits / 80 in the APP buffer; Windows composition may scale that by the system SDR-reference-white on screen (see gl_hdr_output / gl_hdr_info).
gl_hdr_scene_format0=auto (default) / 1=RGBA16F / 2=R11F_G11F_B10F (no alpha) / 3=RGBA8 (LDR/debug)Pixel format for the HDR scene buffer. Auto picks the best format that actually passes a framebuffer-completeness probe on this backend. RGBA16F is the safe default and keeps the alpha channel that the sky / god-ray masking relies on. R11F_G11F_B10F is faster and uses less memory but has NO alpha, so it is only valid once the alpha-marker users are moved. RGBA8 forces the legacy LDR buffer (debug). Unsupported choices fall back to RGBA8 with a reason shown in gl_hdr_info.
gl_hdr_tonemap0=linear/clamp (debug) / 1=Reinhard / 2=ACES filmic (default) / 3=Uncharted filmicTone-mapping curve used to compress HDR scene light to the display. Linear/clamp is a debug passthrough. Reinhard is a simple safe roll-off. ACES filmic is the recommended quality curve. Uncharted is an alternative filmic curve.
gl_hdr_peak_nits100..2000 nits (default 1000)Target peak display brightness in nits that the tone-mapper aims for. Higher values let bright sources stay brighter before rolling off. On an SDR display this acts as the upper anchor of the tone curve rather than a literal panel brightness.
gl_hdr_paper_white_nits100..400 nits (default 200)Brightness assigned to ordinary white world / UI surfaces inside the HDR scene. Raising it lifts mid-tones; lowering it gives more tonal headroom to very bright sources before they clip.
gl_hdr_egl_app_white_max0.25..8.0 (default 1.1; recommended 1.1 for win32egl HDR)win32egl-only true-HDR output limiter for the app-side scRGB white scale. It caps the EGL app buffer before Windows composition applies its HDR SDR-white presentation scale. Lower values protect bright lamp/sun/moon detail from EGL overexposure; higher values make EGL HDR brighter but can blow out highlights. win32wgl ignores this setting.
gl_hdr_exposure-4..+4 EV (default 0)Manual exposure compensation in EV stops applied to the HDR scene before tone mapping. 0 is neutral; +1 doubles scene brightness, -1 halves it.
gl_hdr_bloom_threshold_nits0..8 HDR units (default 2.0)Bloom onset threshold expressed in HDR (nits-derived) scene units. Pixels brighter than this start to bloom. Higher restricts bloom to only the brightest sources.
gl_hdr_bloom_strength0..3 (default 1.0)HDR-aware bloom strength multiplier applied on top of the bloom chain in HDR mode.
gl_hdr_saturation0..2 (default 1.0)Optional post-tone-map saturation adjustment. 1.0 is neutral; lower desaturates, higher boosts color.
gl_hdr_contrast0..2 (default 1.0)Optional post-tone-map contrast adjustment. 1.0 is neutral; higher increases contrast, lower flattens it.
gl_hdr_emissive_peak_scale0..8 (default 1.0)HDR-only peak multiplier for emissive MAP and SPAWN light contributions (the static emissive-light channel). 1.0 = neutral; higher makes those sources read brighter before tone mapping. Only effective when gl_hdr is active. (HDR-3b wires map/spawn emissive only; lightning/sparks/projectile peak scaling is deferred to a later phase.)
gl_hdr_celestial_peak_scale0..8 (default 1.0)HDR peak multiplier for celestial highlights. Currently scales the sun/moon disk peak and the accepted sun/star/planet bloom contribution. It does NOT scale direct star/planet point color (that experiment produced a diamond-fragment artifact and was reverted; a future attempt needs a non-fragmenting soft-glow approach). Only effective when gl_hdr is active.
gl_hdr_fx_peak_scale0..8 (default 1.0)HDR-only peak multiplier for the AVFX LIGHTNING visual family. 1.0 = neutral; higher writes true overbright so lightning blooms past white through the tone-map instead of clipping flat. Only effective when gl_hdr is active. HDR-4b scales only the AVFX-lightning paths explicitly marked for lightning HDR peak: sky flash, force-bloom lightning beam/halo/surface-arc segments, and cloud illumination. Model/powerup shells, item vis-tints, snow glints, plain grapple/BFG beams, weapon sparks, projectile lights and static emissive map lights are NOT scaled by this knob. Future non-lightning FX peak routing is deferred.

Practical guidance:

HDR rendering: normally Auto. The forced mode is for diagnostics.
HDR output: enable it only with an HDR display and Windows HDR turned on.
Output mode: use extended highlights for the real effect.
Scene format: Auto picks the best supported path.
Tone mapping: ACES is a good general choice and the default.
Peak brightness: set it to your monitor's real peak.
Paper white: 200 is a good start. Lower makes the ordinary base darker, higher makes the interface and the scene brighter.
Exposure: use it sparingly, and only after paper white and peak are set.



3. WGL and EGL

win32wgl is the main recommended path for true HDR. It gives a more direct OpenGL output path on modern drivers and usually preserves bright peaks better without losing detail.

win32egl is useful for performance and compatibility. For HDR output it needs Windows system HDR enabled. Because of differences in the swap chain and the colour space, EGL can need a separate white-level adjustment.

VariableAccepted valuesDescription
gl_hdr_egl_app_white_max0.25..8.0 (default 1.1; recommended 1.1 for win32egl HDR)win32egl-only true-HDR output limiter for the app-side scRGB white scale. It caps the EGL app buffer before Windows composition applies its HDR SDR-white presentation scale. Lower values protect bright lamp/sun/moon detail from EGL overexposure; higher values make EGL HDR brighter but can blow out highlights. win32wgl ignores this setting.

If bright sources turn into white blobs on EGL:

1. Leave the peak brightness and the paper white the same as on WGL.

2. Lower the white cap in steps of 0.05: 1.10 → 1.05 → 1.00.

3. If the image became too dull, return to 1.10 or raise the exposure slightly.

4. For a final image, use WGL unless you have a reason to stay on EGL.


4. Gamma and compatibility with older configs

This is a separate topic that is easily confused with HDR.

VariableAccepted valuesDescription
vid_gammadefault 1 / range 0.3..3 / step 0.05 / r_reload/vid_restartCompatibility texture gamma used by existing Q2/Q2PRO configs. Default 1.0 = identity; lower values brighten texture mid-tones, higher values darken them. On programmable WGL/EGL it is baked into wall/skin texture uploads and therefore needs r_reload or vid_restart; it never changes the whole final frame. With vid_hwgamma 1, the display backend may instead consume this curve as a hardware gamma ramp. Owned by the unified global video config when global video preferences are enabled.
vid_display_gammadefault 1 / range 0.3..3 / step 0.05 / liveOptional live final-composite gamma for programmable WGL/EGL. Default 1.0 is neutral; lower values brighten the complete frame and higher values darken it. This new control is deliberately independent from legacy vid_gamma and never inherits its persisted value. Owned by the unified global video config when global video preferences are enabled.
The former gamma variable keeps its compatible semantics: it affects the gamma of wall and model textures and does not recolour the whole final frame. The change applies after a resource or video-mode reload, exactly as in earlier builds.
For deliberate live gamma of the whole frame there is a separate variable with a neutral default. It does not inherit older values.

If an old config made the image unexpectedly bright or dark, start here rather than with the HDR settings.


5. HDR presets in AVFX

The HDR presets live in the AVFX preset section. They assume the internal HDR renderer is on. The music variants stop the current online-music track and start their own; the ordinary variants change only the visual profile.

Details about the slots and the preset rules are in the AVFX presets guide.



6. Screenshots

An ordinary JPEG screenshot is enough for a comparison. For true HDR use:

screenshotjxr

screenshotjxr_raw

The JXR format is what preserves the extended range. A JPEG may look fine as an illustration, but it is not a check of the HDR data. HDR quality is verified by eye on an HDR display and through gl_hdr_info.


7. Diagnostics

gl_hdr_info prints the backend capabilities, the scene format and the current output path. The command changes nothing.

There is also a separate HDR diagnostic overlay. It is a developer aid, acts only for the current session and is never written to a config:

VariableAccepted valuesDescription
gl_hdr_debug0=off / 1=false-color luminance / 2=histogram / 3=overbright clip maskHDR diagnostic overlay. Off is normal rendering. False-color shows per-pixel luminance bands. Histogram shows the exposure / luminance distribution. Clip mask highlights pixels that exceed the display range. Developer aid; not archived.

The clip mask is the most useful mode for a player: it directly shows the pixels that exceed the display range.


8. Common problems

SymptomWhat to check
No HDR effect at allWindows system HDR, HDR output enabled, the backend, and a loaded map
The scene looks ordinaryThe extended-highlights output mode, the peak brightness and the paper white; try WGL
Lamps, the Moon and the Sun turn into blobs on EGLLower the EGL white cap
The interface or ordinary white is too brightLower the paper white
Everything is too darkRaise the paper white first, then the exposure carefully
The image changed after loading an old configCheck the gamma, not HDR