Skip to content
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

ToneMappingEffect affects the background color #678

Open
MajorMeerkatThe3rd opened this issue Jan 27, 2025 · 2 comments
Open

ToneMappingEffect affects the background color #678

MajorMeerkatThe3rd opened this issue Jan 27, 2025 · 2 comments
Labels
feature request New feature request

Comments

@MajorMeerkatThe3rd
Copy link

Currently the ToneMappingEffect affects the background color, this can be reproduced on the demo page.

It would be very helpful to have a setting to ignore the background, like for other passes.

@vanruesc
Copy link
Member

vanruesc commented Feb 5, 2025

Hi,

I agree that it would be a useful feature to have, but there are currently no plans to add support for masking to ToneMappingEffect. The reason being transparent objects.

Implementing masking based on min/max depth wouldn't be too difficult. However, transparent objects don't write depth so all transparent fragments rendered on top of the background would no longer be tone mapped. Depth-based masking also causes aliasing artifacts around object edges and it requires additional texture sampling which isn't free.

I haven't tried this, but it might be possible to modify three's skybox shader to output untonemapped/inverse-tonemapped colors (http://www.codersnotes.com/notes/untonemapping/). After applying tone mapping, the final output should then look closer to the original colors.

@vanruesc vanruesc added the feature request New feature request label Feb 5, 2025
@MajorMeerkatThe3rd
Copy link
Author

Hello @vanruesc,

thank you for this very insightful answer! This makes the complexity of the issue much more clear to me.
Once I find some time, I'll try the suggested approach and will report back!

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants