diff --git a/tests/test_gltf.py b/tests/test_gltf.py index 8794c48bd..10207f895 100644 --- a/tests/test_gltf.py +++ b/tests/test_gltf.py @@ -307,7 +307,8 @@ def test_specular_glossiness(self): ) assert metallic_roughness.shape[0] == 84 and metallic_roughness.shape[1] == 71 - metallic = metallic_roughness[:, :, 0] + # https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#metallic-roughness-material + metallic = metallic_roughness[:, :, 2] roughness = metallic_roughness[:, :, 1] assert g.np.allclose(metallic[0, 0], 0.231, atol=0.004) diff --git a/trimesh/visual/gloss.py b/trimesh/visual/gloss.py index 8c4065685..ffad0e125 100644 --- a/trimesh/visual/gloss.py +++ b/trimesh/visual/gloss.py @@ -360,7 +360,7 @@ def convert_texture_lin2srgb(texture): # we need to use RGB textures, because 2 channel textures can cause problems result["metallicRoughnessTexture"] = toPIL( np.concatenate( - [metallic, 1.0 - glossiness, np.zeros_like(metallic)], axis=-1 + [np.zeros_like(metallic), 1.0 - glossiness, metallic], axis=-1 ), mode="RGB", )