<!--
{
  "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/LightmapComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17LightmapComponentV"
  },
  "title" : "LightmapComponent"
}
-->

# LightmapComponent

Describes how a lightmap is applied to parts of the scene.

```
struct LightmapComponent
```

## Overview

[`LightmapComponent`](/documentation/RealityKit/LightmapComponent) specifies which children of its owning entity should have a lightmap
applied to them, and connects those children to their corresponding data in a [`LightmapResource`](/documentation/RealityKit/LightmapResource).

To use [`LightmapComponent`](/documentation/RealityKit/LightmapComponent), first create a [`LightmapResource`](/documentation/RealityKit/LightmapResource) using textures produced by an offline
baking process. Then, create a new [`LightmapComponent`](/documentation/RealityKit/LightmapComponent) backed by the [`LightmapResource`](/documentation/RealityKit/LightmapResource), and use
the [`entityIndexInLightmapResource`](/documentation/RealityKit/LightmapComponent/entityIndexInLightmapResource) property to map each entity that you wish to be lightmapped, to its
corresponding slot in the lightmap resource. Finally, add the [`LightmapComponent`](/documentation/RealityKit/LightmapComponent) to an entity that sits
above all of the lightmapped entities in the hierachy.

## See Also

[`LightmapResource`](/documentation/RealityKit/LightmapResource)

A resource containing references to lightmap texture atlases
and descriptions of how parts of the atlases map to meshes in
the scene.



---

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)