KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.48k stars 317 forks source link

KHR_texture_transform with rotation possibily wrong #2366

Open timknip opened 16 hours ago

timknip commented 16 hours ago

Describe the bug A glTF file with the KHR_texture_transform extension looks good in some (ugh) online viewers but looks wrong after importing into blender. Viewers showing ok:

So basically the question is who's got it right.

To Reproduce Steps to reproduce the behavior:

  1. import this file xxxx49519510811a3a8e7b686fcfb4152d0ff26f_09.COLOR_MORSECHARCOAL.zip
  2. look at the texture which is wrongly applied: bad

Expected behavior The texture should look good: good

Version

I suspect the conversion to the Mapping node can be wrong in some cases.

Due to inconsistent behavior in different viewers, it's unclear which implementation is correct.

scurest commented 14 hours ago

https://gltf-viewer.donmccurdy.com/ is known to have a wrong implementation of KHR_texture_transform, see https://github.com/mrdoob/three.js/issues/15831 (note that despite being closed, the issue was never fixed). Since Babylon and Blender agree, they seem likely to be correct.

In practical terms, you should probably avoid rotations since they never received a consistent implementation.