@threlte/extras

<Detailed>

<Detailed> is an abstraction around ThreeJS’s LOD. A common technique to improve performance is to swap out high-detail models or meshes for low-detail ones at large distances.

Notice how as the mesh’s distance from the camera increases, a geometry with less vertices is shown.

The distance between the camera and the <Detailed> component itself is what determines which level-of-detail to use. You can set positions for children but they will not be used in the distance calculation.

Children of <Detailed> accept a distance prop. This prop determines the visibility of each child based on its distance from the camera. If not specified, distance defaults to 0.

<Detailed>
  <T.Mesh>
    <T.BoxGeometry />
  </T.Mesh>
  <T.Mesh distance={10}>
    <T.BoxGeometry />
  </T.Mesh>
</Detailed>

Children of <Detailed> accept a hysteresis prop which can be used to prevent flickering at LOD boundaries. If not specified, hysteresis defaults to 0.

<Detailed>
  <T.Mesh hysteresis={0.5}>
    <T.BoxGeometry />
  </T.Mesh>
</Detailed>

It is fairly common to export a high-detail, medium-detail, and low-detail model from 3D asset creation tools.

Component Signature

<Detailed> extends <T . LOD> and supports all its props, slot props, bindings and events.