-
Notifications
You must be signed in to change notification settings - Fork 686
Description
HDR images can be drawn an infinite number of ways, often unrepresentable as a single bitmap (e.g, gainmap images). There exists a general problem wherein an HDR image must be put into pixels in a buffer. At the moment the HDR image is put into pixels in a buffer, this infinite number of ways of representing it must be collapsed into a single representation.
This problem exists in 2D canvas at drawImage time (see analogous issue) and in WebGPU at copyExternalImageToTexture and importExternalTexture time (see analogous issue).
This problem also exists in WebGL at tex[Sub]Image time. This explainer proposes to add an unpackHDRHeadroom attribute to WebGLRenderingContextBase, indicating the amount of tone mapping (if any) to perform when populating the texture's pixels.
Unlike 2D canvas and WebGPU, WebGL has a few special "opt out of color space conversion" situations (e.g, UNPACK_COLORSPACE_CONVERSION_WEBGL ). The unpackHDRHeadroom attribute will be ignored in the same situations where unpackColorSpace is ignored.