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

error THREE.GLTFLoader: setKTX2Loader #2170

Closed
vladimir-rybalko opened this issue Aug 22, 2023 · 4 comments
Closed

error THREE.GLTFLoader: setKTX2Loader #2170

vladimir-rybalko opened this issue Aug 22, 2023 · 4 comments
Assignees
Labels

Comments

@vladimir-rybalko
Copy link

Your Environment

Version used: current master
Browser Name and version: Chrome and FF
Operating System and version (desktop or mobile): Windows
Link to your project: https://codesandbox.io/s/itowns-3d-tiles-kt6r4x

Context

When loading 3D tiles, an error occurs - THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures.
Data prepared in Agisoft Metashape.
image

@jailln
Copy link
Contributor

jailln commented Aug 23, 2023

Some 3D Tiles contains GLTFs with textures compressed with KTX2. To load them, you need to specify to the GLTFLoader a KTXLoader that points to the ktx2 decoder library. I implemented an helper function enableKtx2Loader (similar to enableDracoLoader) to do so in #2172. I tested it with your model and it works

@vladimir-rybalko
Copy link
Author

Some 3D Tiles contains GLTFs with textures compressed with KTX2. To load them, you need to specify to the GLTFLoader a KTXLoader that points to the ktx2 decoder library. I implemented an helper function enableKtx2Loader (similar to enableDracoLoader) to do so in #2172. I tested it with your model and it works

Thank you for your quick response.
I compiled the code from your repository and fixed some of the code in the my sandbox. The error has fixed, but I don't see the model in the scene.
@jailln, сan you attach a working example of the code here so that I can understand what my problem?

@jailln
Copy link
Contributor

jailln commented Aug 24, 2023

I pushed it on this branch. You can clone it, do npm install, npm start and go to http://localhost:8080/examples/vladimir-example.html :

image

It has no roof though 😁 but this may come from the model?

@vladimir-rybalko
Copy link
Author

The no roof though is a model problem.
Thanks for the help, it works.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants