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

Textures not loading using GLTFLoader #393

Closed
MasoudShah opened this issue Sep 14, 2024 · 8 comments
Closed

Textures not loading using GLTFLoader #393

MasoudShah opened this issue Sep 14, 2024 · 8 comments
Assignees
Labels
bug Something isn't working Three.js

Comments

@MasoudShah
Copy link

Hi, I have used GLTFLoader to load gltf or glb models, but the textures don't load at all and I just watch the model, all black. I searched and noticed @kalwalt has already faced this issue in this link. If my problem is exactly the same problem in the link, I wish the threejs file be updated in this repository. I saw that the version of ARnft repository is newer than jsartoolkitNFT. I just switched the files, but nothing showed on the screen, not even the black model with no texture. Please let me know what the problem is.

@kalwalt kalwalt self-assigned this Sep 14, 2024
@kalwalt
Copy link
Member

kalwalt commented Sep 14, 2024

hi @MasoudShah do you get some errors in the console log? It could be that the GLTFLoader is for a different three.js version but i'm not completely sure.

@MasoudShah
Copy link
Author

MasoudShah commented Sep 14, 2024

It might be. At first I got an error for this line var loader = THREE.Loader.Handlers.get( sourceURI ); that it's kind of deprecated, so I changed it to var loader = options.manager.getHandler(sourceURI); and error disappeared. This is at line 2165. But after that, the problem that no texture is loaded, showed up.

@MasoudShah
Copy link
Author

@kalwalt the threejs version was 126 but GltfLoader was 103. I updated GltfLoader to 126 but still no luck. The textures don't load and the model is all black.

@kalwalt
Copy link
Member

kalwalt commented Oct 23, 2024

@MasoudShah i will look into this issue soon, I want to release a new version fixing some bugs and doing some upgrades.

@kalwalt kalwalt added bug Something isn't working Three.js labels Oct 23, 2024
kalwalt added a commit that referenced this issue Oct 24, 2024
@kalwalt
Copy link
Member

kalwalt commented Oct 25, 2024

@MasoudShah I have just created a gltf example in PR #397 take a look at and let me know if this help you.

@MasoudShah
Copy link
Author

MasoudShah commented Oct 26, 2024

Thanks for your reply but it seems it doesn't load some of the textures. What I see is the picture below.
Clipboard Image (74)
What I must see is this.
Clipboard Image (75)
I compared them using gltf-viewer and in the options, the light settings are the same. I don't know if it is just light settings or it might be something else. I also added a directional light but it still seems different from the original one.

@kalwalt
Copy link
Member

kalwalt commented Oct 26, 2024

I compared them using gltf-viewer and in the options, the light settings are the same. I don't know if it is just light settings or it might be something else. I also added a directional light but it still seems different from the original one.

I think it's how to to setup your three.js code, it's not an issue with jsartoolkitNFT itself. what about this?
Screenshot 2024-10-26 155816
Code in commit 250f57f i will merge it soon.

@MasoudShah
Copy link
Author

MasoudShah commented Oct 26, 2024

It seems you're right. I will close this issue. Thanks a lot!

kalwalt added a commit that referenced this issue Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Three.js
Projects
None yet
Development

No branches or pull requests

2 participants