Closed vladimir-rybalko closed 1 year ago
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
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 functionenableKtx2Loader
(similar toenableDracoLoader
) 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?
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
:
It has no roof though :grin: but this may come from the model?
The no roof though is a model problem. Thanks for the help, it works.
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.