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

metallicRoughnessTexture encoding is wrong #84

Open
helviett opened this issue Dec 17, 2023 · 4 comments
Open

metallicRoughnessTexture encoding is wrong #84

helviett opened this issue Dec 17, 2023 · 4 comments

Comments

@helviett
Copy link

The spec says:

The textures for metalness and roughness properties are packed together in a single texture called metallicRoughnessTexture. Its green channel contains roughness values and its blue channel contains metalness values. This texture MUST be encoded with linear transfer function and MAY use more than 8 bits per channel.

But metallic-roughness textures in Sponza folder are encoded with sRGB. Checked it with ImageMagick and PVRTexTool.

@javagl
Copy link
Contributor

javagl commented Dec 17, 2023

Depending on whether someone can definitely say whether this is duplicate of the issue around KhronosGroup/glTF-Sample-Models#316 (comment) , it might be closed. (I think it is, but others should confirm...)

@donmccurdy
Copy link

donmccurdy commented Dec 17, 2023

tl;dr – the ICC profiles are often wrong, the data is likely not sRGB. Agreed it'd be nice if we can fix the ICC profiles, that's a bit of a messy area in photo-editing software historically IMHO. Implementations of glTF are required to ignore the profiles for that reason.

I'd be open to putting something in glTF-Transform to fix incorrect ICC profiles too though, it'd be ideal to have these samples be clean unless there're explicitly testing that requirement. The library I'm currently using (sharp.js) does not let me edit the ICC profile without re-encoding the image, unfortunately.

@DRx3D
Copy link
Contributor

DRx3D commented Dec 18, 2023

This repo is being ARCHIVED. Transferred to glTF-Sample-Assets.

@DRx3D DRx3D transferred this issue from KhronosGroup/glTF-Sample-Models Dec 18, 2023
@donmccurdy
Copy link

I've looked into this more, and haven't yet found a clear answer as to how one should tag a particular image as "non-color data". With KTX2 textures there's a clear way to do this. With ICC profiles and EXIF, I have no idea. See discussion in:

lovell/sharp#4011

I imagine this is all part of the reason the spec requires implementations to ignore any ICC profile present. Anything else would require some external convention on how to represent non-color data in images, and that convention does not appear to exist today. 😕

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

No branches or pull requests

4 participants