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

Incorrect colors in ViewRenderable #60

Closed
grassydragon opened this issue May 5, 2021 · 2 comments · Fixed by #68 or #70
Closed

Incorrect colors in ViewRenderable #60

grassydragon opened this issue May 5, 2021 · 2 comments · Fixed by #68 or #70
Assignees

Comments

@grassydragon
Copy link
Contributor

Hello, @ThomasGorisse!
When using the colors with the full pixel intensity, for example, the red #ff0000, green #00ff00 and blue #0000ff colors, they are displayed incorrectly on a ViewRenderable. This can be tested by changing the label background color here:
https://github.com/ThomasGorisse/sceneform-android-sdk/blob/master/samples/gltf/src/main/res/drawable/rounded_bg.xml#L18
I think that this is caused by the inverseTonemapSRGB function here:
https://github.com/ThomasGorisse/sceneform-android-sdk/blob/master/core/assets-sources/materials/sceneform_view_material.mat#L41
Should I ask about that in the Filament repository since I get the same results in the hello-triangle example?

@grassydragon grassydragon self-assigned this May 5, 2021
@ThomasGorisse
Copy link
Collaborator

Hi @grassydragon,

You are totally right about it.
Actually I put it in the TODO list since I was not completely sure about the ViewRenderable inverseTonemapSRGB original usage reason.
I already removed it elsewhere (in the Renderable class from what I can remember) without issues (also from what I can remember).
I actually try not to spend too much time on the Sceneform little bug fixes and focus more on the new framework publication date.

But it would be very helpful for anyone using Sceneform if you could ask the Filament team about the reason why inverseTonemapSRGB could have been used. Link the question to this issue and make a quick PR.

Thanks a lot for your great report !

@grassydragon
Copy link
Contributor Author

As I understand the inverseTonemapSRGB does two things. It converts the color from the sRGB space to the linear space and applies the inverse transformation to cancel the tone-mapping effect. The problem can be solved by converting the color manually as described in the FIlament materials guide: https://google.github.io/filament/Materials.html#handlingcolors/linearcolors. I will ask about that because I am not sure about the performance impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants