<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelRenderer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer08LowLevelC0C"
  },
  "title" : "LowLevelRenderer"
}
-->

# LowLevelRenderer

A renderer that encodes draw calls for a collection of mesh instances into a
Metal command buffer.

```
final class LowLevelRenderer
```

## Overview

`LowLevelRenderer` manages camera constants, per-instance transforms, MSAA resolve,
tonemapping, and optional color gamut conversion. You are responsible for creating and
committing the Metal command buffer; the renderer only encodes into it.

## Topics

### Creating a renderer

[`convenience init(configuration: LowLevelRenderer.Configuration, renderContext: any LowLevelRenderContext) async throws`](/documentation/RealityKit/LowLevelRenderer/init(configuration:renderContext:))

Creates a renderer, asynchronously compiling all required GPU resources.

[`struct Configuration`](/documentation/RealityKit/LowLevelRenderer/Configuration)

The configuration for a renderer.

### Rendering a frame

[`func render(using: any MTLCommandBuffer, (inout LowLevelRenderer.RenderState) -> ())`](/documentation/RealityKit/LowLevelRenderer/render(using:_:))

Encodes draw calls for the frame into the given command buffer using a caller-controlled
render callback.

[`struct RenderState`](/documentation/RealityKit/LowLevelRenderer/RenderState)

The per-frame render state passed to the `render(using:_:)` callback.

[`struct Resources`](/documentation/RealityKit/LowLevelRenderer/Resources)

Prepared GPU resources for a renderer.

### Managing mesh instances

[`func meshInstances(at: Int) -> LowLevelMeshInstanceArray?`](/documentation/RealityKit/LowLevelRenderer/meshInstances(at:))

Returns the mesh instance array at the given slot index, or `nil` if the slot is unoccupied.

[`func setMeshInstances(LowLevelMeshInstanceArray?, at: Int) throws(LowLevelRendererError)`](/documentation/RealityKit/LowLevelRenderer/setMeshInstances(_:at:))

Assigns a mesh instance array to the given slot index.

[`var meshInstancesArrayCount: Int`](/documentation/RealityKit/LowLevelRenderer/meshInstancesArrayCount)

The number of mesh instance array slots.

### Culling and sorting instances

[`static func cullMeshInstances(LowLevelMeshInstanceArray, indices: Span<Int>, outIndices: inout OutputSpan<Int>, configuration: LowLevelRenderer.CullConfiguration)`](/documentation/RealityKit/LowLevelRenderer/cullMeshInstances(_:indices:outIndices:configuration:))

Culls mesh instances against a frustum, writing surviving indices to an output span.

[`static func cullMeshInstances(LowLevelMeshInstanceArray, indices: Span<Int>, configuration: LowLevelRenderer.CullConfiguration) -> [Int]`](/documentation/RealityKit/LowLevelRenderer/cullMeshInstances(_:indices:configuration:))

Culls mesh instances against a frustum and returns the surviving indices.

[`struct CullConfiguration`](/documentation/RealityKit/LowLevelRenderer/CullConfiguration)

The configuration for a frustum culling operation.

[`static func sortMeshInstances(LowLevelMeshInstanceArray, indices: inout MutableSpan<Int>, configuration: LowLevelRenderer.SortConfiguration)`](/documentation/RealityKit/LowLevelRenderer/sortMeshInstances(_:indices:configuration:))

Sorts the given mesh instances by sort category and, for transparent instances,
by back-to-front distance from the camera.

[`struct SortConfiguration`](/documentation/RealityKit/LowLevelRenderer/SortConfiguration)

The configuration for a mesh instance sort pass.

### Configuring cameras

[`var cameras: LowLevelRenderer.CameraArray`](/documentation/RealityKit/LowLevelRenderer/cameras)

The array of active cameras.

[`struct CameraArray`](/documentation/RealityKit/LowLevelRenderer/CameraArray)

A mutable, fixed-capacity array of camera values.

[`struct Camera`](/documentation/RealityKit/LowLevelRenderer/Camera)

The view and projection parameters for a single camera.

### Managing color matching

[`var colorMatch: LowLevelRenderer.ColorMatch`](/documentation/RealityKit/LowLevelRenderer/colorMatch-swift.property)

The active color gamut conversion. The renderer applies this value only when `enableColorMatch` is `true`
in `Configuration`.

[`struct ColorMatch`](/documentation/RealityKit/LowLevelRenderer/ColorMatch-swift.struct)

A color gamut conversion applied during resolve.

[`func setColorMatch(targetingColorSpace: CGColorSpace) throws(LowLevelRendererError)`](/documentation/RealityKit/LowLevelRenderer/setColorMatch(targetingColorSpace:))

Updates the color match by computing a gamut conversion matrix from the renderer’s
working color space to the given target display color space.

[`var workingColorSpace: CGColorSpace`](/documentation/RealityKit/LowLevelRenderer/workingColorSpace)

The color space in which the renderer performs all shading calculations.

### Accessing render output

[`var output: LowLevelRenderer.Output`](/documentation/RealityKit/LowLevelRenderer/output-swift.property)

The per-frame output target configuration, including color and depth textures,
viewports, and render target dimensions.

[`struct Output`](/documentation/RealityKit/LowLevelRenderer/Output-swift.struct)

The per-frame output target configuration for a renderer.

[`var renderTargetDescriptor: LowLevelRenderTarget.Descriptor`](/documentation/RealityKit/LowLevelRenderer/renderTargetDescriptor)

The render target descriptor derived from the renderer’s configuration.

### Initializers

[`init(resources: LowLevelRenderer.Resources) throws(LowLevelRendererError)`](/documentation/RealityKit/LowLevelRenderer/init(resources:))

Creates a renderer using pre-compiled GPU resources.

### Instance Properties

[`var time: Float`](/documentation/RealityKit/LowLevelRenderer/time)

The scene time, in seconds, that the renderer passes to shaders as a uniform.

---

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)