useGLTF
A convenience hook that uses useLoader
and GLTFLoader
, it defaults to CDN loaded draco binaries (https://www.gstatic.com/draco/v1/decoders/
) which are only loaded for compressed models.
// Loads model, uses CDN draco when needed
useGLTF(url)
// Use local draco binaries from a custom path
useGLTF(url, '/draco-gltf')
// Preload asset (you would do this in global space, not inside a component!)
useGLTF.preload(url)