-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KHR_displayencoding #2083
KHR_displayencoding #2083
Conversation
First draft version of an outputmaping extension using Perceptual Quantizer
Clarify that proper visualization of hue is important when this extension is used. Explain how exporters shall handle light contribution values before exporting. Add schema, opto-optical transfer function values.
Improve wording so that implementers will more easily understand what is needed to implement this extension.
Update aperture schema
Should be 'color primaries', also add ITU
I see a lot of value in automatic exposure control in order to avoid over bright areas or underbought areas. Overbright areas tend to have color shift because of the per-channel per-pixel tone mapping operators in use. I think that we should expect viewers to just use the proper color space for their displays. I am not sure we should put into a 3D file what its expect transfer function to that display is. I guess we could put exposures into individual glTF files but that feels a little weird. What happens if you open up multiple glTF files that have conflicting exposures or tone mapping parameters? My recommendation may be that this is a viewer certification issue and we come up with guidelines for handling automatic exposure, tone mapping and transfer functions. Tone mapping and automatic exposure controls and proper transfer functions should be part of viewers, rather than part of the individual glTF files. I would love to see that happen! Because to put it into a glTF file we are sort of assuming that viewers are going to be using incorrect, less than optimal OOTF, unless you use this extension. That is a bit weird. |
To solve the questions of how to handle multiple loaded glTFs with or without this extension:
|
In order to be able to support multiple glTF models with this extension enabled the parameters for OOTF are removed. The values for rangeExtension and gamma are hardcoded based on HDR or LDR output. The aperture setting is moved to scene level, this is to make it more intuitive to handle multiple glTFs
Note that PQ is used in game engines as the transfer function for HDR output (as dictated by HDR10 and Dolby Vision), it is not used as the "tone mapping" curve (that bit is done by the "S curve" in the Lumberyard diagram for instance). PQ is also sometimes used as a log encoding for 3D LUT lookup. |
To simplify the extension and make content creation more intuitive, the max light intensity is limited to 10 000. Removing the need for scene aperture calculations - replaced with 'clamp & normalize'
One are where this might be considered too prescriptive is that the output for HDR and SDR screens is still subject to a W3C Draft and not finalized, including a number of open issues. Adding the entire chain until PQ-encoded data is sent through the wire to a display as part of this extension will, if I'm not understanding these proposals wrong, for the foreseeable future not be possible in web viewers. |
Side note, when following your steps (open "http://gltf.ux3d.io/", enable "Force Displaymapping PQ" in Advanced Settings) results in a non-clipped image that nonetheless looks bad: Would this be your intended result for this file? |
Sure, and then web-viewers will use the SDR target until they can get access to swapchain format and colorspaces.
Then it seems that they have already implemented the HDR part of this extension. Why would they do "double-encoding"? |
Absolutely not, this seems to be a bug in the Sample-Viewer use of the transmission or volume extension. Try without the displaymapping extension enabled, not using 'image based' and change the "compensatory light intensity" - you will notice that nothing changes. |
This assumption is wrong. KHR_displaymapping_pq - is designed to be compatible with a number of usecases that mix several glTF models, can have varied and changing light conditions and at the same time render with expected result (to both SDR and HDR displays) KHR_image_formation has one usecase and that is the 'Main product picture' type of usecase - showing one model under fixed light conditions and at the same time applying color-grading (a filter) |
Not while retaining compatibility with different usecases such as Metavers, AR, 'Furnish the home' or 3D Commerce. I have already proposed to change that extension into one that defines a physical camera with aperture/shutter/ISO - nothing else - to be used together with this extension. I think that is the best way forward. |
Use the same image for different light intensities (certification chair)
Add frambuffer for clarification
…p/glTF into KHR_outputmapping_pq
AKA - "The calibration opto-electrical transfer function" or "The certification display encoding"
The purpose of this extension is to enable consistent material representation under highly varying lighting conditions.
At the same time retaining color representation (hue) - in usecases that mix models and light setup from multiple glTF sources.
Priority is to retain the spectral properties of the material and incoming lights - output shall be neutral, unfiltered and raw.
Meaning that filtering, tonemapping, colorgrading or other type of post-processing effects are not part of this extension.
Neither is any kind of operations or processing with the goal of simulating how humans interpret the visual input, the goal is to output physically correct raw or unadjusted color values.
The following requirements shall be met:
Output value shall retain the spectral properties of the material and those of the lights.
It is assumed that the light contribution in any given glTF scene can vary from low values to very high values.
These, internal, values must then be matched to a range that is acceptable by displays.
This is usually in the [0.0 - 1.0] range at a precision of 8 bits, with HDR displays increasing the precision to 10 or 12 bits.
This extension is compatible with both HDR and SDR displays.
The intended usecases for this extension is any usecase where the light contribution values will go above 1.0, for instance by using KHR_lights_punctual, KHR_emissive_strength or KHR_environment_lights.
It defines the output range - which is unspecified in the glTF spec but generally treated as:
1.0 equals a fully exposed pixel
The output is now defined as a display, with target of interactive framrates but compatible with pathtracers, with the maximum output value of 10000.
Making this extension suitable to be used as a calibration display encoding function extension with the purpose of retaining color values (hue) as ouput from the glTF BRDF.
The choice of perceptual quantizer is to make this extension future proof and compatible with the existing HDR standards.
Hdr monitors are already on the market and support will only grow, for instance fully embraced by Windows 10/11 and MacOS.
This makes sure the extension is future proof.
Sample Viewer implementation - drag and drop you models as usual.
Go into "Advanced controls" and enable "Force Displaymapping PQ"
The "Compensatory light intensity" is one directional light with the intensity in LUX (lumen / m2) as defined by KHR_lights_punctual.
KhronosGroup/glTF-Sample-Viewer#391
Babylon playground 'hack' - note that this is not fully implemented - light values must be kept within 0 - 10 000 lumen / m2, don't mix with IBLs as they will look totally wrong.
https://playground.babylonjs.com/#AHVICB#12