One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

RealityRenderer

class · iOS 18.0+ · SDK 27.1

class RealityRenderer

A renderer that displays a RealityKit scene in an existing Metal workflow. All RealityKit APIs for loading resources, creating entities and adding components are compatible and work with `RealityRenderer`.

Members (17)

get · iOS 18.0+

activeCamera

TypeScript
get activeCamera(): (Entity) | null
Swift declaration
var activeCamera: Entity? { get set }

The camera to be used for rendering.

set · iOS 18.0+

activeCamera

TypeScript
set activeCamera(value: (Entity) | null)
Swift declaration
var activeCamera: Entity? { get set }

The camera to be used for rendering.

get · iOS 27.0+

audioListener

TypeScript
get audioListener(): (Entity) | null
Swift declaration
var audioListener: Entity? { get set }

The entity which defines the listener position and orientation for spatial audio. By default this `audioListener` property is nil, which means that the active camera entity will be used as the audio listener. The `audioListener` can be set to any entity in the `scene` to use the transform of the entity as the audio listener position and orientation.

set · iOS 27.0+

audioListener

TypeScript
set audioListener(value: (Entity) | null)
Swift declaration
var audioListener: Entity? { get set }

The entity which defines the listener position and orientation for spatial audio. By default this `audioListener` property is nil, which means that the active camera entity will be used as the audio listener. The `audioListener` can be set to any entity in the `scene` to use the transform of the entity as the audio listener position and orientation.

get · iOS 18.0+

cameraSettings

TypeScript
get cameraSettings(): RealityRenderer_CameraSettings
Swift declaration
var cameraSettings: RealityRenderer.CameraSettings

The settings to be used for rendering with `activeCamera`.

set · iOS 18.0+

cameraSettings

TypeScript
set cameraSettings(value: RealityRenderer_CameraSettings)
Swift declaration
var cameraSettings: RealityRenderer.CameraSettings

The settings to be used for rendering with `activeCamera`.

method · iOS 18.0+

updateAndRender

TypeScript
updateAndRender(deltaTime: number, cameraOutput: RealityRenderer_CameraOutput, whenScheduled?: (((arg0: RealityRenderer) => void)) | null, onComplete?: (((arg0: RealityRenderer) => void)) | null, actionsBeforeRender?: Array<RealityRenderer_MetalEventAction>, actionsAfterRender?: Array<RealityRenderer_MetalEventAction>): Promise<void>
Swift declaration
@MainActor @preconcurrency func updateAndRender(deltaTime: TimeInterval, cameraOutput: RealityRenderer.CameraOutput, whenScheduled: (@Sendable (RealityRenderer) -> Void)? = nil, onComplete: (@Sendable (RealityRenderer) -> Void)? = nil, actionsBeforeRender: [RealityRenderer.MetalEventAction] = [], actionsAfterRender: [RealityRenderer.MetalEventAction] = []) throws

Tick the simulation and render using activeCamera and the camera rendering output. - Parameters: - deltaTime: The delta time to advance the simulation - cameraOutput: Specifies output for rendering with ``activeCamera`` - whenScheduled: A handler that is called when the corresponding MTLCommandBuffer is scheduled - onComplete: A handler that is called when the corresponding MTLCommandBuffer is complete - actionsBeforeRender: Array of events and values to wait before GPU rendering work - actionsAfterRender: Array of events and values to signal after GPU rendering work

get · iOS 18.0+

extendedDynamicRangeOutput

TypeScript
get extendedDynamicRangeOutput(): boolean
Swift declaration
var extendedDynamicRangeOutput: Bool { get set }

Specify whether the target Metal layer has been configured for EDR output. If the Metal layer that this ``RealityRenderer`` will be rendering into has been configured to output extended dynamic range content (i.e. the property ``QuartzCore/CAMetalLayer/wantsExtendedDynamicRangeContent`` on the target ``QuartzCore/CAMetalLayer`` has been set to `true` and a pixel format that supports EDR content has been set), this property should be set to `true` so that ``RealityRenderer`` adjusts its tone mapping accordingly. To control the amount of headroom available for extended dynamic range content, see ``extendedDynamicRangeHeadroom``. The default value is `false`.

set · iOS 18.0+

extendedDynamicRangeOutput

TypeScript
set extendedDynamicRangeOutput(value: boolean)
Swift declaration
var extendedDynamicRangeOutput: Bool { get set }

Specify whether the target Metal layer has been configured for EDR output. If the Metal layer that this ``RealityRenderer`` will be rendering into has been configured to output extended dynamic range content (i.e. the property ``QuartzCore/CAMetalLayer/wantsExtendedDynamicRangeContent`` on the target ``QuartzCore/CAMetalLayer`` has been set to `true` and a pixel format that supports EDR content has been set), this property should be set to `true` so that ``RealityRenderer`` adjusts its tone mapping accordingly. To control the amount of headroom available for extended dynamic range content, see ``extendedDynamicRangeHeadroom``. The default value is `false`.

get · iOS 18.0+

extendedDynamicRangeHeadroom

TypeScript
get extendedDynamicRangeHeadroom(): number
Swift declaration
var extendedDynamicRangeHeadroom: Float { get set }

The amount of headroom available for extended dynamic range content. When EDR output is enabled using ``extendedDynamicRangeOutput``, standard dynamic range values output by this ``RealityRenderer`` will be scaled such that there's some _headroom_ to display extended range values. This value is in the range `[1.0-16.0]`. The default value is `2.0`.

set · iOS 18.0+

extendedDynamicRangeHeadroom

TypeScript
set extendedDynamicRangeHeadroom(value: number)
Swift declaration
var extendedDynamicRangeHeadroom: Float { get set }

The amount of headroom available for extended dynamic range content. When EDR output is enabled using ``extendedDynamicRangeOutput``, standard dynamic range values output by this ``RealityRenderer`` will be scaled such that there's some _headroom_ to display extended range values. This value is in the range `[1.0-16.0]`. The default value is `2.0`.

method · iOS 18.0+

update

TypeScript
update(deltaTime: number): Promise<void>
Swift declaration
@MainActor func update(_ deltaTime: TimeInterval) throws

Tick the simulation - Parameter deltaTime: The delta time to advance the simulation

get · iOS 18.0+

entities

TypeScript
get entities(): Promise<RealityRenderer_EntityCollection>
Swift declaration
@MainActor var entities: RealityRenderer.EntityCollection { get set }

A collection of RealityKit entities that this renderer renders within the scene.

set · iOS 18.0+

entities

TypeScript
setEntities(value: RealityRenderer_EntityCollection): Promise<void>
Swift declaration
@MainActor var entities: RealityRenderer.EntityCollection { get set }

A collection of RealityKit entities that this renderer renders within the scene.

get · iOS 18.0+

lighting

TypeScript
get lighting(): Promise<RealityRenderer_ImageBasedLight>
Swift declaration
@MainActor var lighting: RealityRenderer.ImageBasedLight { get set }

The lighting used in the environment of a particular scene.

set · iOS 18.0+

lighting

TypeScript
setLighting(value: RealityRenderer_ImageBasedLight): Promise<void>
Swift declaration
@MainActor var lighting: RealityRenderer.ImageBasedLight { get set }

The lighting used in the environment of a particular scene.

init · iOS 18.0+

init

TypeScript
static init(): Promise<RealityRenderer>
Swift declaration
@MainActor init() throws

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

RealityRenderer.subscribe(to:on:componentType:_:)

Passing a Swift type itself is not supported.

All RealityFoundation types →