Contents

sortMeshInstances(_:indices:configuration:)

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

Declaration

static func sortMeshInstances(_ meshInstances: LowLevelMeshInstanceArray, indices: inout MutableSpan<Int>, configuration: LowLevelRenderer.SortConfiguration)

Parameters

  • meshInstances:

    The mesh instance array whose elements to sort.

  • indices:

    The index span to sort in place.

  • configuration:

    The sort configuration supplying the camera position.

Discussion

Call this before render(using:_:) to produce a draw order for the callback. Opaque instances sort before transparent ones; within transparent instances, farther instances sort before nearer ones.

See Also

Culling and sorting instances