Closed 0xGoenka closed 2 years ago
I need to document this, but GLTFLoader will spawn workers if you use DRACO and try to use unsupported browser APIs if you load unpacked GLTFs.
You'll have to pack your model since we can't change GLTFLoader's behavior.
Just for other people who find their way here and are trying to use a GLTF file you can do the following to convert your GLTF model into a GLB (the --transform
option will produce the .glb
model) https://github.com/pmndrs/gltfjsx#%EF%B8%8F-auto-transform-compression-resize:
npx gltfjsx model.gltf --types --transform
Don't forget to add the /native
onto the end of the imports in the generated Model.tsx
file :)
The latest beta should support any GLTF workflow but we're sorting out some issues with arraybuffers (for packed/inlined textures) with react-native core.
Sorting this out with their team and investigating a workaround if there's no quick solution. I've included some light polyfills to implement some missing/broken behavior for the time being.
Hi.
I've cloned this repo, and just added gltf file to assets then only modified the glb file with a gltf file found here =>
Then this error pop =>
`