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

[hio/hdSt] Handling of image colorspaces in MaterialX materials #1878

Closed
pablode opened this issue May 24, 2022 · 1 comment
Closed

[hio/hdSt] Handling of image colorspaces in MaterialX materials #1878

pablode opened this issue May 24, 2022 · 1 comment

Comments

@pablode
Copy link
Contributor

pablode commented May 24, 2022

As discussed in the following issues, MaterialX colorspace handling is currently lacking:
#1523
#1632

I'm working around this in my glTF to USD converter by performing the conversions explicitly using MaterialX math nodes.

One problem that I've encountered with this approach is, that MaterialX <image> nodes do not return raw values. In fact, the sRGB detection logic described in the UsdPreviewSurface spec with the default mode 'auto' is used. This means that all 8-bit RGB and RGBA textures are implicitly, and often incorrectly sRGB-decoded:
https://github.com/PixarAnimationStudios/USD/blob/857ffda41f4f1553fe1019ac7c7b4f08c233a7bb/pxr/imaging/plugin/hioOiio/oiioImage.cpp#L470-L471

In a glTF MaterialX shading network, this affects normal maps, occlusion-roughness-metalness maps, and other textures containing multiple non-color data channels.

I'd propose to set the sourceColorSpace of images used in MaterialX shading networks to 'raw', to allow for easier workarounds. This includes explicit transformations inside the nodegraph, as well as baking of colorspaces into textures.

@jilliene
Copy link

Filed as internal issue #USD-7384

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

2 participants