<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LevelOfDetailComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation22LevelOfDetailComponentV"
  },
  "title" : "LevelOfDetailComponent"
}
-->

# LevelOfDetailComponent

A component that enables Level of Detail (LOD) optimization for entities with multiple detail levels.

```
struct LevelOfDetailComponent
```

## Overview

The component allows entities to automatically show/hide child entities based on viewing conditions,
reducing rendering complexity for distant or small objects.

## Topics

### Creating a component

[`init(levels:switchingAt:)`](/documentation/RealityKit/LevelOfDetailComponent/init(levels:switchingAt:))

Creates a new Level of Detail component.

[`addByCameraDistance(to:levels:)`](/documentation/RealityKit/LevelOfDetailComponent/addByCameraDistance(to:levels:))

Adds Level of Detail configuration using distance-based switching to an entity .

[`addByScreenArea(to:levels:)`](/documentation/RealityKit/LevelOfDetailComponent/addByScreenArea(to:levels:))

Adds Level of Detail configuration using screen area-based switching to an entity.

[`addByResolutionMetric(to:levels:boundingBox:)`](/documentation/RealityKit/LevelOfDetailComponent/addByResolutionMetric(to:levels:boundingBox:))

Adds Level of Detail configuration using resolution metric-based switching to an entity.

### Configuring detail levels

[`levels`](/documentation/RealityKit/LevelOfDetailComponent/levels)

[`LevelOfDetailComponent.DetailLevel`](/documentation/RealityKit/LevelOfDetailComponent/DetailLevel)

An array of entities representing a single detail level.
Entities within a level are shown or hidden together based on LOD selection.

### Choosing a level

[`strategy`](/documentation/RealityKit/LevelOfDetailComponent/strategy)

[`LevelOfDetailComponent.SelectionStrategy`](/documentation/RealityKit/LevelOfDetailComponent/SelectionStrategy)

The strategy used to select which detail level to display.

[`levelSelection`](/documentation/RealityKit/LevelOfDetailComponent/levelSelection-swift.property)

The level selection mode. Defaults to automatic selection based on the strategy.

[`LevelOfDetailComponent.LevelSelection`](/documentation/RealityKit/LevelOfDetailComponent/LevelSelection-swift.struct)

Controls whether LOD selection is automatic or manually overridden.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)