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

sourceColorSpace not set/exposed (USDU-242) #302

Open
Scraft opened this issue Mar 11, 2022 · 0 comments
Open

sourceColorSpace not set/exposed (USDU-242) #302

Scraft opened this issue Mar 11, 2022 · 0 comments

Comments

@Scraft
Copy link

Scraft commented Mar 11, 2022

At the moment, an exported USD, with linear textures, when opened in Blender, will instead read the textures as sRGB. This can be fixed by setting sourceColorSpace for the shader/texture.

https://graphics.pixar.com/usd/release/spec_usdpreviewsurface.html

Flag indicating the color space in which the source texture is encoded. Possible Values:
raw : Use texture data as it was read from the texture and do not mark it as using a specific color space.
sRGB : Mark texture as sRGB when reading.
auto : Check for gamma/color space metadata in the texture file itself; if metadata is indicative of sRGB, mark texture as sRGB . If no relevant metadata is found, mark texture as sRGB if it is either 8-bit and has 3 channels or if it is 8-bit and has 4 channels. Otherwise, do not mark texture as sRGB and use texture data as it was read from the texture.

I have confirmed if I manually add this to the relevant textures (in particular things like normal maps, gloss maps) it fixes rendering issues within Blender. I can see this flag is exposed in the USD SDK:

https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/imaging/hdSt/udimTextureObject.cpp

Actions:

  1. Expose sourceColorSpace so it can be set in code
  2. Automatically set sourceColorSpace appropriately during export.
@etienne-unity etienne-unity changed the title sourceColorSpace not set/exposed sourceColorSpace not set/exposed (USDU-242) Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants