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

glTF roughnessFactor/metallicFactor ignored when a metallicRoughnessTexture is used #623

Closed
silvainSayduck opened this issue May 14, 2019 · 2 comments

Comments

@silvainSayduck
Copy link

commented May 14, 2019

On the latest version of Viro (2.14.0), there are still inconsistencies with the glTF specifications: basically the roughnessFactor or metallicFactor are ignored when a metallicRoughnessTexture is used.

See the below test case for metallicFactor:

From left to right:

  1. No metallicRoughnessTexture, metallicFactor is set to 0
  2. A white texture is used for the metalness, resulting in a fully white metallicRoughnessTexture, metallicFactor is set to 0
  3. A black texture is used for the metalness, resulting in a fully yellow metallicRoughnessTexture (blue channel is zeroed), metallicFactor is set to 0
  4. A white texture is used for the roughness, resulting in a fully white metallicRoughnessTexture, metallicFactor is set to 0
  5. A white texture is used for both metalness and roughness, resulting in a fully white metallicRoughnessTexture, metallicFactor is set to 0
  6. A white texture is used for the roughness, a black texture is used for the metalness, resulting in a fully yellow metallicRoughnessTexture (blue channel is zeroed), metallicFactor is set to 0

Considering that metallicFactor is always set to 0, those six cubes should always appear exactly the same according to the glTF specifications, and they should be non-metallic.

We can see from the image that when a blue channel is present on the metallicRoughnessTexture, the cube is metallic, regardless of the fact that the metallicFactor is set to 0. So cubes 2, 4 and 5 are wrong.

This is quite problematic as it cannot be easily worked-around. For example in the case of a model with a roughness texture, but where metalness is defined from the metallicFactor without any texture. Currently, those models are always fully metallic, which is incorrect.

Here is the glTF of the cubes, and a screenshot from the three.js glTF online Viewer:

@dam00n

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2019

This issue has been fixed in the latest release, ViroReact 2.15.0

Release Notes -> https://docs.viromedia.com/docs/releases

@dam00n dam00n closed this Jul 17, 2019

@silvainSayduck

This comment has been minimized.

Copy link
Author

commented Jul 17, 2019

I can confirm after a short test that this now seems to work as expected! I will update if something comes up after more in-depth testing.

Thanks a lot for the great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.