<!--
{
  "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/cullMeshInstances(_:indices:outIndices:configuration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer08LowLevelC0C17cullMeshInstances_7indices10outIndices13configurationyAA0deG13InstanceArrayC_s4SpanVySiGs06OutputO0VySiGzAC17CullConfigurationVtFZ"
  },
  "title" : "cullMeshInstances(_:indices:outIndices:configuration:)"
}
-->

# cullMeshInstances(_:indices:outIndices:configuration:)

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

```
static func cullMeshInstances(_ meshInstances: LowLevelMeshInstanceArray, indices: Span<Int>, outIndices: inout OutputSpan<Int>, configuration: LowLevelRenderer.CullConfiguration)
```

## Parameters

`meshInstances`

The mesh instance array to test.

`indices`

The candidate indices to test.

`outIndices`

The span that receives surviving indices. Must have free capacity of
at least `indices.count`.

`configuration`

The cull configuration supplying the frustum planes.

## Discussion

Tests each instance’s bounds against the planes in `configuration.frustum`, using
`meshInstance.bounds` when set and falling back to the mesh part’s bounds otherwise.
Instances whose bounds lie entirely outside any single plane are discarded; the rest
are appended to `outIndices` in the same order
as `indices`. `nil` slots in `meshInstances` are skipped.

---

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)