---
title: LightmapResource
framework: realitykit
role: symbol
role_heading: Class
path: realitykit/lightmapresource
---

# LightmapResource

A resource containing references to lightmap texture atlases and descriptions of how parts of the atlases map to meshes in the scene. At a high level, this resource comprises two parts:

## Declaration

```swift
class LightmapResource
```

## Overview

Overview A set of layered textures containing lightmap data. A set of EntityLightmapDescriptors specifying atlas packing. Each descriptor specifies how meshes belonging to the specific entity are mapped to the lightmap atlas (e.g. which texture and which layer contain the relevant lightmap data, and what transform to apply to the lightmap UVs to get the correct data). Both parts (the lightmap data and atlas packing) are expected to be generated by an offline process. This resource is only intended for storing and retrieving them. Importantly, this resource does not store references to runtime Entities. The correspondence between runtime Entities and their matching EntityLightmapDescriptors is established by LightmapComponent.

## Topics

### Creating a lightmap resource

- [init(atlasTextures:perEntityData:)](realitykit/lightmapresource/init(atlastextures:perentitydata:).md)
- [init(perEntityData:)](realitykit/lightmapresource/init(perentitydata:).md)
- [LightmapResource.EntityLightmapDescriptor](realitykit/lightmapresource/entitylightmapdescriptor.md)
- [LightmapResource.MeshPartLightmapDescriptor](realitykit/lightmapresource/meshpartlightmapdescriptor.md)

### Inspecting lightmap contents

- [entityCount](realitykit/lightmapresource/entitycount.md)
- [LightmapResource.AtlasReference](realitykit/lightmapresource/atlasreference.md)

### Specifying bake types

- [bakeTypes](realitykit/lightmapresource/baketypes.md)
- [LightmapResource.BakeType](realitykit/lightmapresource/baketype.md)

### Configuring bake descriptors

- [LightmapResource.BakeDescriptor](realitykit/lightmapresource/bakedescriptor.md)
- [LightmapResource.FinalShadedColorBakeDescriptor](realitykit/lightmapresource/finalshadedcolorbakedescriptor.md)
- [LightmapResource.AmbientOcclusionBakeDescriptor](realitykit/lightmapresource/ambientocclusionbakedescriptor.md)
- [LightmapResource.IndirectDiffuseIrradianceBakeDescriptor](realitykit/lightmapresource/indirectdiffuseirradiancebakedescriptor.md)
- [LightmapResource.IndirectDiffuseIrradianceSHBakeDescriptor](realitykit/lightmapresource/indirectdiffuseirradianceshbakedescriptor.md)

## Relationships

### Conforms To

- [Resource](realitykit/resource.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Lightmaps and light probes

- [LightmapComponent](realitykit/lightmapcomponent.md)
- [DiffuseProbeResource](realitykit/diffuseproberesource.md)
- [DiffuseLightProbeGroupComponent](realitykit/diffuselightprobegroupcomponent.md)
- [DiffuseLightProbeReceiverComponent](realitykit/diffuselightprobereceivercomponent.md)
