Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 604 Bytes

preload.mdx

File metadata and controls

15 lines (12 loc) · 604 Bytes
title sourcecode
Preload
src/core/Preload.tsx

The WebGLRenderer will compile materials only when they hit the frustrum, which can cause jank. This component precompiles the scene using gl.compile which makes sure that your app is responsive from the get go.

By default gl.compile will only preload visible objects, if you supply the all prop, it will circumvent that. With the scene and camera props you could also use it in portals.

<Canvas>
  <Suspense fallback={null}>
    <Model />
    <Preload all />