How to get loading progress with useLoader? #1052
-
This is more of a question than a bug. In From what I've observed with Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Have you looked at |
Beta Was this translation helpful? Give feedback.
-
you can either get it directly from the loader, this is the progress from a single loader only export function useLoader<T, U extends string | string[]>(
Proto: new () => LoaderResult<T>,
input: U,
extensions?: Extensions,
onProgress?: (event: ProgressEvent<EventTarget>) => void
)
useLoader(TextureLoader, url, undefined, console.log) you can get it from the THREE.DefaultLoadingManager, this accounts for all loaded assets or, you use useProgress or small example of the loader component: https://codesandbox.io/s/glas-transmission-fresnel-enx1u |
Beta Was this translation helpful? Give feedback.
Have you looked at
@react-three/drei
->useProgress
hook? It's probably a decent reference for you.