f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Incorrect texture with a specific .glb file

Open mwestphal opened this issue 1 month ago • 2 comments

Describe the bug A specific .glb file texture is not correctly read.

To Reproduce Steps to reproduce the behavior:

  1. Download and extract https://gitlab.kitware.com/-/project/13/uploads/fea9fbb682124cc6105016ffc7d70f19/glbviewer.7z
  2. Open the file using f3d --no-config suzanne.glb
Image

Expected behavior A clear and concise description of what you expected to happen.

System Information:

  • OS: Any
  • GPU and GPU driver: Any

F3D Information Paste the content of f3d --version or f3d-console.exe --version on Windows: 3.3.0

Additional context

VTK issue: https://gitlab.kitware.com/vtk/vtk/-/issues/19846

mwestphal avatar Nov 19 '25 09:11 mwestphal

the material says

"pbrMetallicRoughness": {
        "baseColorTexture": { "index": 0, "texCoord": 1 },

so UVs should be read from TEXCOORD_1 but could they be wrongly read from the default TEXCOORD_0 instead?

Let's swap the buffer views for TEXCOORD_0 and TEXCOORD_1 to check:

           "attributes": {
             "POSITION": 0,
             "NORMAL": 1,
-            "TEXCOORD_0": 2,
-            "TEXCOORD_1": 3
+            "TEXCOORD_0": 3,
+            "TEXCOORD_1": 2
           },
           "indices": 4,
           "material": 0
Image

see unpacked gltf version: suzanne-gltf.zip

So I guess the first thing to investigate would be whether texCoord is properly handled all the way in VTK's importer/reader

snoyer avatar Nov 19 '25 11:11 snoyer

Nice, thanks for the investigation @snoyer !

mwestphal avatar Nov 19 '25 15:11 mwestphal