CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 36k
WebGLRenderer: Add Support for Khronos Neutral Tone Mapping #27668
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Add support for `CommereceToneMapping`.
Add support for `CommerceToneMapping`.
@elalish I've added two minor changes to your branch to make sure |
Add reference for `CommerceToneMapping`.
Great tone mapper! However, as discussed offline... I'm not a fan of the "Commerce" name and would very much prefer renaming it to something like "Neutral" before it's not too late 😇 Maybe "Khronos' Neutral Tone Mapper"? |
For anyone curious, the tonemapping can also be tried out here, across a wide range of Khronos sample models:
|
To be less verbose, maybe Anyway, the docs should be updated. |
What @WestLangley said 👍 |
I'll merge and clean up. |
Thanks! |
Hi |
Yes, it's optimized for sRGB display, since glTF textures are sRGB. The function itself is applied in a linear colorspace. |
Why Im asking is because of while this tone mapper looks good on test meshes and simple objects, but when I use it in large scenes with a lots of trees, grass and concrete objects they all became a bit into red / brown colors. This happens when use on linear sRGB color space (and after use tone mapper next is conversion to non linear space). This is how this tone mapper is applied now. In this case scene with nature looks weird with shifted colors. But if we apply this tone mapper after converting from linear sRGB into non-linear sRGB (encoded) (ie. this tone mapper will be really last step in transformation chains in shaders, last color modification) - then it looks much nicer and removes only slight whiteness and make image only a bit darker, but saves most of the colors. Due to explanation above I want to ask what was intended / expected from this tone mapper or how you wanted it should work? Do this tone mapper must remove only a bit light zones from image and make it bit darker or this tone mapper also should change colors too (ex. light green to yellow-green, gray to red-brown etc)? |
The most important thing is what you're comparing to. If you're comparing to another render, even with "no tone mapping" you will see shifted colors, because PBR already shifts colors and neutral corrects that. Neutral is only designed to preserve basecolor texture colors to the render when the lighting is grayscale. For any other use, it's probably not the right tool. I can tell you more if you show your basecolor texture, your IBL, and your render. Even better if you can pick out corresponding RGB values. In three.js it is already implemented to handle the colorspaces properly. |
This is the tone mapper I designed for color-accuracy and that we are working to make a standard through the Khronos 3D Commerce group. In-depth writeup here. The summary is this is an improved alternative to No/Linear/Clamped tone mapping. It preserves the baseColor sRGB values as faithfully as possible through to the final render under uncolored lighting.
Improvements over No tone mapping:
Improvements over ACES/AgX:
Situations where AgX is a better choice:
I've already shipped this in
<model-viewer>
and I intend to make it our default in v4.0. You can test it yourself by drag-and-dropping any GLB and HDR into this Glitch.FYI @mrdoob @WestLangley @donmccurdy @bhouston @hybridherbst