---
title: "init(atlasTextures:perEntityData:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/lightmapresource/init(atlastextures:perentitydata:)"
---

# init(atlasTextures:perEntityData:)

Initializes the resource with the given atlases and entity descriptors. The resources within atlasTextures must be 2D texture arrays. Textures containing data for ambient occlusion should be single-channel textures. Textures containing data for beauty bakes should contain RGBA color. Textures for diffuse irradiance should contain RGBA data. There should be 3 slices per atlas page. Each of the 3 slices contains data red, green and blue channels of irradiance respectively. Each texel within a slice contains coefficients for spherical harmonic functions of 0th and 1st degree, with the R channel providing the coefficient for 0th degree spherical harmonic, and G, B and A channels providing coefficients for the 1st degree spherical harmonics (with orders -1, 0 and 1 respectively).

## Declaration

```swift
@MainActor convenience init(atlasTextures: [TextureResource], perEntityData: [LightmapResource.EntityLightmapDescriptor]) throws
```

## See Also

### Creating a lightmap resource

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