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

On import, roughness is hard coded to read from the R texture channel (USDU-223) #311

Open
jcowles opened this issue Jun 1, 2022 · 2 comments

Comments

@jcowles
Copy link
Contributor

jcowles commented Jun 1, 2022

The roughness value in a texture can be declared in USD to come from any channel, for example, in this asset it comes from the alpha channel:
image

However, the roughness combiner shader is hard coded to only read from the R channel:
image

The issue is in CombineAndConverRoughness.shader and the CombineRoughness C# function.

@jcowles jcowles added the bug label Jun 1, 2022
@jcowles
Copy link
Contributor Author

jcowles commented Jun 2, 2022

Repro case (rename to .usdz):
test-roughness.usdz.zip

This is the expected output - the top text should have roughness 0.0, next 0.3, next 0.6. The bottom three text lines have the same roughness, but set as constants.

Note that the .tga is sRGB gamma encoded to 2.2, so when decoded to linear space, the values should be 0.0, 0.3 and 0.6.

@jcowles
Copy link
Contributor Author

jcowles commented Jun 2, 2022

There's actually two bugs here:

  1. The texture is not packed correctly
  2. Because this test asset uses multiple channels from a single texture, we should get 3 roughness textures in Unity, but instead we only get 1

Problem 1:
image

Problem 2:
image

@etienne-unity etienne-unity changed the title On import, roughness is hard coded to read from the R texture channel On import, roughness is hard coded to read from the R texture channel (USD-223) Aug 17, 2022
@lee-aandrew lee-aandrew changed the title On import, roughness is hard coded to read from the R texture channel (USD-223) On import, roughness is hard coded to read from the R texture channel (USDU-223) Jan 3, 2023
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