-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
WebGPURenderer: Unlit materials should not be tone mapped #28831
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
Comments
This is not a bug, It is still possible to use |
Maybe it's important to highlight once more that So |
The main purpose for |
Hmm... I am inclined to think that is too restrictive. If all materials are tone mapped, I think we have to have a way to disable it. Think of overlay text or a heads-up display. That would not normally be tone mapped. Nor should something like Tone mapping can cause significant hue shifts. So can exposure control. |
HUD is normally used in another |
What about the other issues I mentioned? |
The @WestLangley I don't think we can achieve what you are asking for without changing some fundamentals in the renderer. I do not vote for doing this since tone mapping and color space conversion is now more correctly implemented than in |
There was always a difference when tone mapping was applied inline and when used in FX workflows via |
Since I believe that other cases could be solved with MRT properties applied to the material and PostProcessing, such as: material.mrtNode = mrt( { overlay: directionToColor( normalWorld ) } ); This is being developed initially here #28833 if we look at the projects from the three.js home page, I think 99% will make better use of the new system, |
Another example use case would be text labels. Historical context: a related post from @bhouston. |
Sorry, but I think this goes in the wrong direction. The If tone mapping is configured for a render output, it should affect the entire image and not specific objects. That is also true for color space conversion. Issues like #24362, #23019 or clear color related tone mapping and sRGB issues stem from the fact the engine did not implement this step correctly. I think it's best if |
Normal, depth and velocity materials (and similar utility materials) are intended to be rendered into linear space only - never sRGB and also never tone mapped. This is because they need to be encoded consistently so that they can be decoded consistently. Thus toneMapping should never be supported on them. |
Should we add more logic in the renderers to automatically render objects that shouldn't be tone mapped in a different pass? That way we won't need to deprecate |
I think that could be a good option. I'm also wondering if we may want to bring back the option of rendering directly to the drawing buffer (with tone mapping and color space transforms in the fragment shader), simply for performance reasons. If so that would be another option here. |
Yes. I support that. I think that should be the default -- just as it is in |
It is 2x faster or better than using post-processing in my original tests - in part because it can use RGBA8 buffers rather than multiple FP buffers: #8250 |
Just wanted to clarify some pros and cons and why Pros
Cons
Alternative
Just wanted to make a note of this. |
Thank you, @sunag, for your comments. I use Regarding tone mapping, only lit materials need to be tone mapped -- not the entire scene. You wouldn't typically tone map a solid scene background color, scene clear-color, a heads-up display, |
For me the overriding concern is that color management and tone mapping must be cheap for mobile and WebXR devices with WebGPURenderer. When an application's performance budget can afford lighting, tone mapping should be near-zero extra cost. If that's not possible with post-processing (I don't have hardware to test this; do we feel #30387 has solved it?) then I think we really need to find a solution for the performance, and materials used for debugging like MeshNormalMaterial can be considered downstream of that problem. That said... I don't feel that per-material opt-out for tone mapping is the only solution here at all, we don't have to take the same approach as WebGLRenderer if that's a concern. Something like |
How about if we inline tone mapping in This allows This way, we are able to tone map only the materials that respond to light -- not the entire scene. |
I don't think all users are looking for this in the same way #26208 (comment), #26857 (comment). I created an example showing how to use fog and background without tone-mapping in a scene with tone-mapping using TSL https://threejs.org/examples/?#webgpu_custom_fog_background. It is recommended that HUDs be made in another render-pass, even to enable advanced effects such as blurring or blending like overlay. Inline tone-mapping does not solve what I mentioned above #28831 (comment) and TSL already supports blending background and fog without tone-mapping, the only strong reason I see is about skipping post-processing, which seems to me to be far from the reality of the current graphics generation but if we are going to add it as an alternative like |
MeshNormalMaterial
should not be tone mapped
Uh oh!
There was an error while loading. Please reload this page.
Description
WebGLRenderer:
MeshNormalMaterial
inherits the.toneMapped
property astrue
, but the material omits the tone mapping shader chunks, so the material is never tone mapped.This is the correct behavior. We never want the material to be tone mapped.
WebGPURenderer:
MeshNormalMaterial
responds to tone mapping. It should not. This needs to be fixed.Note: There are other problems with
MeshNormalMaterial
that cause the material to be washed out when rendered withWebGPURenderer
. That will be addressed in a separate PR after this issue is resolved.Reproduction steps
Code
// code goes here
Live example
Screenshots
No response
Version
r167dev
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: