---
title: "generateSTMap(device:cameraEye:stmapType:into:)"
framework: Immersive Media Support
role: symbol
role_heading: Instance Method
platforms: [iOS 26.4+, iPadOS 26.4+, Mac Catalyst 26.4+, macOS 26.0+, visionOS 26.0+]
path: "immersivemediasupport/immersivecameralensdefinition/generatestmap(device:cameraeye:stmaptype:into:)"
---

# generateSTMap(device:cameraEye:stmapType:into:)

Generates an STMap for the given projection type and for the given camera eye into the provided texture asynchronously.

## Declaration

```swift
func generateSTMap(device: any MTLDevice, cameraEye: ImmersiveCameraLensDefinition.Eye, stmapType: ImmersiveCameraLensDefinition.STMapType, into texture: any MTLTexture) async throws
```

## Parameters

- `device`: The metal device to use during the STMap generation.
- `cameraEye`: The camera side to use for generating the STMap.
- `stmapType`: The type of STMap output: Equirectangular or Equidistant are the current options.
- `texture`: The output texture where the STMap will be stored.
