Skip to content

Commit

Permalink
Merge pull request #2231 from FrozenBurning/main
Browse files Browse the repository at this point in the history
Fixes #2195
  • Loading branch information
mikedh authored Jul 25, 2024
2 parents 7f2aa95 + 6c80e24 commit 99cd376
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/test_gltf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion trimesh/visual/gloss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down

0 comments on commit 99cd376

Please sign in to comment.