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

Background color isn't interpreted correctly #42

Closed
rawnsley opened this issue Sep 23, 2021 · 6 comments · Fixed by #130
Closed

Background color isn't interpreted correctly #42

rawnsley opened this issue Sep 23, 2021 · 6 comments · Fixed by #130
Assignees
Labels
P1 Address as quickly as possible

Comments

@rawnsley
Copy link
Contributor

There's a mismatch between how the background color looks in Blender and how it looks in Hubs, particularly for dark colors. I presume it's an RGB / sRGB thing, but I can't find a definitive reference for what color space Blender exports colors in.

Screenshot 2021-09-23 at 11 39 40

@camelgod
Copy link
Contributor

@rawnsley Is the background color still wrong with Blender Filmic after the Tone Mapping changes from 0.0.13? I think the Blender Filmic should give proper tone map now.

@rawnsley
Copy link
Contributor Author

@rawnsley Is the background color still wrong with Blender Filmic after the Tone Mapping changes from 0.0.13? I think the Blender Filmic should give proper tone map now.

I don't think it was a tone mapping problem originally; probably a question of linear vs sRGB. I'll check next time I'm in Blender mode.

@Exairnous
Copy link
Contributor

Exairnous commented Jul 12, 2022

I believe that the issue is the exporter is storing the color in linear, but Hubs is reading it as sRGB. This also affects the fog color, and will affect the mirror component when it's added.

@netpro2k @keianhzo This should be a pretty easy fix, but somebody needs to decide whether it's Hubs that should be reading colors from glTF files in linear space or if the exporter should be writing out the colors as sRGB.

Edit: I don't think the issues with the recent threejs update have had any effect on this issue, but it may be better to wait until those are resolved and see if the issue is still present.

@keianhzo keianhzo self-assigned this Sep 14, 2022
@keianhzo keianhzo added the P1 Address as quickly as possible label Sep 14, 2022
@Exairnous
Copy link
Contributor

Exairnous commented Sep 15, 2022

I think that's just converting it from a 0-1 range float into a hex color, so to fix it you'd need to convert the linear color to sRGB and then convert it to a hex color.

@keianhzo
Copy link
Contributor

keianhzo commented Sep 15, 2022

We need to do a linear to sRGB conversion here:
https://github.com/MozillaReality/hubs-blender-exporter/blob/0c593374c01506ee7fdf1963a68c5cc998c8c6fb/addons/io_hubs_addon/io/utils.py#L300
I have a fix, I'll push a PR.

I wonder if switching the property from COLOR to COLOR_GAMMA would also work, probably it would.

@Exairnous
Copy link
Contributor

I tried COLOR_GAMMA after you mentioned it, but I'm pretty sure there wasn't any change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Address as quickly as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants