Chrome has implemented the “WebGPU Extended Range Brightness” proposal for some time now, and it’s also supported by the Safari Technology Preview. I am wondering if there is any interest in exploring support for this tech, since it removes the restriction for the browser to clamp colors to the 0–1 range.
To be clear, I am talking about support for Three to output “brighter than #ffffff” colors to displays that support it. I don’t mean traditional tonemapped images of the same name, where multiple photo exposures are composed into a regular sRGB image. This is also different to how the renderer’s linear HDR colors are tonemapped to the SDR range (e.g. Reinhard, Cineon, ACESFilmic, AgX…).
If you’ve seen true HDR colors, you know: they’re stunning, rich, immersive, and lifelike. Since ThreeJS calculates PBR shading internally with HDR numbers, simply displaying those extra bright colors could yield really impressive and detailed renders. Currently, tonemapping simply discards (or carefully clamps) all of that highlight information, which seems like a waste if the monitor could otherwise display a lot of it.
MacBook Pro supports true HDR colors, but many new monitors and TVs offer at least some degree of support.
As an initial test, perhaps ThreeJS would only need to call the webgpu context.configure()
function with a couple of extra params outlined in the webgpu-hdr explainer. It seems that there’s even a webgl analog too (a few extra properties on the context) so this could ultimately be supported by all renderers.
I’m not sure if ThreeJS frag shaders currently clamp buffer colors to 0…1, but it’s possible that setting the renderer’s toneMapping
property to NoToneMapping
would allow the renderer’s unclamped linear rgb colors to “shine through” to the “extended” buffer. Longer term, implementing “extended” versions of the tonemapping algorithms would probably be important, to avoid harsh clipping at the display’s brightness limit.
I’m also not sure whether there is any way to query that limit. I imagine HDR-ness varies wildly between devices, so HDR tonemapping algorithms probably need to be able to adjust their “rolloff” threshold to a wide range of maximum brightnesses.