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

Out-of-gamut colors produced by inverse tone mapping cause hue shifts #3909

Open
grassydragon opened this issue May 7, 2021 · 8 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@grassydragon
Copy link

Hello!
As stated in this issue in the maintained Sceneform repository (SceneView/sceneform-android#60) the inverseTonemapSRGB function makes the colors with the full pixel intensity appear incorrectly. Is it because the inverseTonemapSRGB function is an approximation and isn't suitable for converting colors from the sRGB space to the linear space (I think that is why it is used in the ViewRenderable material in Sceneform)?

@romainguy
Copy link
Collaborator

Can you define "incorrectly" please? What's the expected output and the actual output?

This function will be exact if you choose the FILMIC tone mapper in the ColorGrading API. It will be an approximation with other tone mappers.

@grassydragon
Copy link
Author

Here is what happens when I set the color in the hello-triangle example to #0000ff.
Without inverseTonemapSRGB:
Screenshot_20210507-184859
With inverseTonemapSRGB:
Screenshot_20210507-184354
I expect the color to be close to blue.

@romainguy
Copy link
Collaborator

It should be blue, the approximation should not cause this.

@romainguy
Copy link
Collaborator

Oh never mind I understand what's going on. It's a hue skew caused by out of gamut colors. You can workaround the problem for now by using the FILMIC tone mapping operator instead of the default ACES_LEGACY.

@romainguy romainguy self-assigned this May 7, 2021
@romainguy romainguy added the bug Something isn't working label May 7, 2021
@romainguy romainguy changed the title inverseTonemapSRGB makes colors appear incorrectly Out-of-gamut colors produced by inverse tone mapping cause hue shifts May 7, 2021
@grassydragon
Copy link
Author

Thank you for the quick reply!

@alexey-pelykh
Copy link
Contributor

@romainguy any ETA on this issue?

@pixelflinger
Copy link
Collaborator

No ETA yet. It's probably going to be a while.

@pixelflinger pixelflinger added the enhancement New feature or request label Jul 7, 2021
@ThomasGorisse
Copy link
Contributor

Sorry for asking it again but we are updating to the last 1.10.6 and we'd like to know if we can suppress our workaround:

filamentView.setColorGrading(
    new ColorGrading.Builder()
        .toneMapping(ColorGrading.ToneMapping.FILMIC)
        .build(EngineInstance.getEngine().getFilamentEngine())
);

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

No branches or pull requests

5 participants