<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LightmapComponent/SurfaceExtractor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17LightmapComponentV16SurfaceExtractorC"
  },
  "title" : "LightmapComponent.SurfaceExtractor"
}
-->

# LightmapComponent.SurfaceExtractor

This is a helper for extracting certain surface properties from entities within a
lightmapped scene and rendering them out into the atlas defined by the light map.

```
@MainActor class SurfaceExtractor
```

## Topics

### Creating a surface extractor

[`init(lightmapRootEntity: Entity) throws`](/documentation/RealityKit/LightmapComponent/SurfaceExtractor/init(lightmapRootEntity:))

### Extracting surfaces

[`func extractSurfacesForAtlasSlice(mode: LightmapComponent.SurfaceExtractor.ExtractionMode, atlasTextureIndex: Int, textureSliceIndex: Int, cameraOutput: RealityRenderer.CameraOutput, cameraTransform: Transform, cameraFOVDegrees: Float, onComplete: (() -> Void)?) throws`](/documentation/RealityKit/LightmapComponent/SurfaceExtractor/extractSurfacesForAtlasSlice(mode:atlasTextureIndex:textureSliceIndex:cameraOutput:cameraTransform:cameraFOVDegrees:onComplete:))

[`enum ExtractionMode`](/documentation/RealityKit/LightmapComponent/SurfaceExtractor/ExtractionMode)

Specifies what surface property to extract.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)