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

[Bug] GLTF texture issues #3190

Open
finetjul opened this issue Dec 13, 2024 · 5 comments
Open

[Bug] GLTF texture issues #3190

finetjul opened this issue Dec 13, 2024 · 5 comments
Assignees
Labels
module: example Affect example module: I/O type: bug 🐞 Errors in functionality

Comments

@finetjul
Copy link
Member

Bug description

There are issues with the textures (and the normals?) in the GLTF example.

image

Steps to reproduce

Open the GLTF example and zoom on the King in the ABeautifulGame model.

image

Detailed Behavior

No response

Expected Behavior

Correct textures

Environment

  • vtk.js version: master
  • Browsers: Chrome
  • OS: Windows
@finetjul finetjul added type: bug 🐞 Errors in functionality module: I/O module: example Affect example labels Dec 13, 2024
@daker
Copy link
Collaborator

daker commented Dec 13, 2024

This is not a bug, PBR is not supported in the webgl implementation so i am just using addTexture in webgl which works in some cases. If you switch to WebGPU you will see the correct rendering.

https://github.com/Kitware/vtk-js/blob/master/Sources%2FIO%2FGeometry%2FGLTFImporter%2FReader.js#L247-L253

@finetjul
Copy link
Member Author

Could it be that coordinate textures are not the same between WebGL and WebGPU ? It's odd that the same texture renders fine in WebGPU but not in WebGL. There must be a discrepancy somewhere hence it is a bug...

@daker
Copy link
Collaborator

daker commented Dec 13, 2024

Since the PBR is implemented for WebGPU only the diffuse texture is applied here with addTexture (workaround) the others are not applied (Normal, Roughness, Emission and Occlusion textures) because the code is using the PBR property methods

A working example with one texture https://kitware.github.io/vtk-js/examples/GLTFImporter/index.html?model=BoxTextured&viewAPI=WebGL

@finetjul
Copy link
Member Author

It may works in trivial case, but with the chessmate dataset, it seems that there is issues with coordinate textures:

image

@daker
Copy link
Collaborator

daker commented Dec 13, 2024

I will try to see if there is something wrong or missing in the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: example Affect example module: I/O type: bug 🐞 Errors in functionality
Projects
None yet
Development

No branches or pull requests

2 participants