-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Roadmap for supporting wide-gamut color workflows #26479
Comments
@WestLangley – continuing from our technical discussion, I've added more TODOs in the task list above. Please let me know if you feel anything major is missing or doesn't belong. :) |
PR for 2.1, 2.2, 2.3, and 2.6 — We should work toward offering a tone map adapted for wide-gamut and HDR displays, and with a more neutral default appearance than ACES Filmic. Blender 4.0 will be moving to AgX as the default, and I believe that would be a good choice for us as well. Related details:
Blender 4.0 alpha builds are available with AgX support now. I've prototyped an implementation in three.js. I am not sure about how to add support for other working and display color spaces yet. The implementation can also be optimized by removing the 1D LUT. /cc @bhouston |
@donmccurdy great work! I also strongly agree that we should aim to provide AgX as an alternative tone mapping and maybe if there is enough acceptance, we can switch it to the default. |
Updates:
|
@WestLangley from your comment in #26666 (comment) –
If we're reading from the render target in sRGB we do need to get that data in correctly, right? We can safely "ignore" the color space now because writing Linear-sRGB to the sRGB target will lead WebGL to (automatically?) apply the sRGB OETF for us, and we don't want our fragment shader doing that. I think we may want to go one step further here. If we are writing to a uint8 render target having Display P3 color space, from working color space Linear sRGB, our fragment shader should do the gamut mapping and let WebGL do the OETF. Writing non-linear data to a f16 or f32 render target would not be supported, because WebGL doesn't support it. |
I think what you said is correct, and I don't think it is contrary to my statement. 🤔 |
Did this AgX feature request get merged into the latest version of threejs? I couldn't tell.
|
It hasn't been — I don't think anyone is working on it currently. Additional discussion here: |
Gotcha thanks Don, I'm not sure your Glitch link is working anymore. With Blender 4.0 any assets users create in Blender and show in three.js look quite different. Your LUT approach although perhaps not totally accurate seems quite flexible and I think many 3D designers like myself are very used to LUTs due to their popularity in game engines like Unreal and Unity, would love to test with that LUT file, I assume it's a .CUBE or .png? I am currently using pmndrs PostProcessing library and @vanruesc mentioned it would be more efficient to have natively in three.js first which I understand, but maybe I can just use your LUT in his library and see how close I can match the colors between Blender 4 and Three.js. |
The LUT is part of the prototyping process here – it isn't really something we want in the final implementation, and doesn't represent the complete tone mapper. A better realtime implementation (like Filament's) would replace the LUT with a fitted function. I think AgX is something we can and should support independently of pursuing support for wide-gamut color, so let's continue that discussion in a new thread: |
Related:
Roadmap and discussion for supporting for wide-gamut color spaces in three.js. Many displays now support Display P3 (+50% larger gamut volume than sRGB), and web browsers are beginning to extend that support to WebGL contexts. Other color wide-gamut color spaces exist (Rec. 2020, ACEScg) and may be relevant to our internal rendering pipeline, but probably will not be widely available as display color spaces in WebGL for a very long time.
Broadly the goals here are (1) to identify useful and correct workflows for users, and (2) to make any necessary changes in the three.js rendering pipeline. I suspect that (1) may be the harder part of the problem.
Decisions
Workflows
I'm skeptical than wide-gamut features can be enabled automatically; it will require significant care from users to get the benefits of these displays, and should be opt-in. I'm not sure which 3D modeling tools support the P3 gamut at all. Files in standard formats like glTF are almost exclusively using sRGB today. Users will need to load textures manually and assign
texture.colorSpace
correctly. We cannot infer texture color space safely without user input of some kind.Tasks
Task numbers begin at 2.1, following up from #23614.
ColorManagement.workingColorSpace
renderer.outputColorSpace = THREE.DisplayP3ColorSpace
gl.unpackColorSpace
to unpack "display-p3" PNG, JPEG, and WebP images into the working color spaceThe text was updated successfully, but these errors were encountered: