---
title: "init(device:venueDescriptor:depthPixelFormat:colorPixelFormat:)"
framework: Immersive Media Support
role: symbol
role_heading: Initializer
platforms: [macOS 27.0+, visionOS 27.0+]
path: "immersivemediasupport/immersivepreviewrenderer/init(device:venuedescriptor:depthpixelformat:colorpixelformat:)"
---

# init(device:venueDescriptor:depthPixelFormat:colorPixelFormat:)

Creates an immersive preview renderer.

## Declaration

```swift
@MainActor init(device: (any MTLDevice)? = nil, venueDescriptor: VenueDescriptor? = nil, depthPixelFormat: MTLPixelFormat? = nil, colorPixelFormat: MTLPixelFormat? = nil)
```

## Parameters

- `device`: The MTLDevice to use.
- `venueDescriptor`: The VenueDescriptor to use to render the ImmersiveVideoFrame.
- `depthPixelFormat`: The depth pixel format to use.
- `colorPixelFormat`: The pixel format of the color attachment.

## Discussion

Discussion The renderer is initialized with optional Metal device and pixel format configurations. If you don’t provide a device, the renderer uses the system default Metal device. You can set the venue descriptor during initialization or update it later through the venueDescriptor property.
