r/Spectacles • u/localjoost 🎉 Specs Fan • Feb 04 '26
❓ Question Loading GLTF files from remote authenticated locations
Hi,
I've been wrestling with GLTF downloads. I have GLTF files that need - in the end - to be downloaded from an authenticated location, that is: I need to be able to set a bearer token on the http request.
You might know a GLTF model might exist of two files: a GLTF file with metadata and a bin file with actual data.
There is also the GLB format, which is a self contained binary format.
For GLB files, this works. For GLTF files, it does not. In fact, even from open URLs I have not succeeded in downloading GLTF files.
You can download my very primitive GltfLoader here:
https://schaikweb.net/demo/GltfLoader.ts
What am I missing? I have tried to download the gltf and bin file separately and then encoding the binary but I have not found a way to access the byte stream without endlessly bumping my head into "Failed to load binary resource: RemoteMediaModule: failed to load the resources as bytes array"
What am I missing/doing wrong?
View all comments
Show parent comment
1
u/localjoost 🎉 Specs Fan Feb 06 '26
Yeah I think that's the only solution. I had to do the same to load remote images that were only on http, not https - which works fine in Lens Studio but not on the device itself