init(device:venueDescriptor:depthPixelFormat:colorPixelFormat:)
Creates an immersive preview renderer.
Declaration
@MainActor init(device: (any MTLDevice)? = nil, venueDescriptor: VenueDescriptor? = nil, depthPixelFormat: MTLPixelFormat? = nil, colorPixelFormat: MTLPixelFormat? = nil)Parameters
- device:
The
MTLDeviceto use. - venueDescriptor:
The
VenueDescriptorto use to render theImmersiveVideoFrame. - depthPixelFormat:
The depth pixel format to use.
- colorPixelFormat:
The pixel format of the color attachment.
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.