---
title: "makeMeshInstance(meshPart:pipeline:geometryArguments:surfaceArguments:lightingArguments:transform:sortCategory:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelrendercontext/makemeshinstance(meshpart:pipeline:geometryarguments:surfacearguments:lightingarguments:transform:sortcategory:)"
---

# makeMeshInstance(meshPart:pipeline:geometryArguments:surfaceArguments:lightingArguments:transform:sortCategory:)

Creates a drawable mesh instance pairing a mesh part with a compiled pipeline state and optional per-draw argument tables.

## Declaration

```swift
func makeMeshInstance(meshPart: LowLevelMeshPart, pipeline: LowLevelRenderPipelineState, geometryArguments: LowLevelArgumentTable?, surfaceArguments: LowLevelArgumentTable?, lightingArguments: LowLevelArgumentTable?, transform: simd_float4x4, sortCategory: LowLevelMeshInstance.SortCategory) throws -> LowLevelMeshInstance
```

## Parameters

- `meshPart`: The mesh part this instance draws.
- `pipeline`: The compiled pipeline state used to render this instance.
- `geometryArguments`: The argument table bound to the geometry modifier stage, or nil if none.
- `surfaceArguments`: The argument table bound to the surface shader stage, or nil if none.
- `lightingArguments`: The argument table bound to the lighting function stage, or nil if none.
- `transform`: The initial model-to-world transform of this instance.
- `sortCategory`: The category (opaque or transparent) for sorting.

## Return Value

Return Value A newly created LowLevelMeshInstance.

## Discussion

Discussion Pass nil for any argument table stage not required by the material. note: An error if the pipeline or argument tables are incompatible with the render context.

## See Also

### Creating meshes

- [makeMeshResource(descriptor:)](realitykit/lowlevelrendercontext/makemeshresource(descriptor:).md)
- [makeMeshPart(resource:indexOffset:indexCount:primitive:windingOrder:bounds:)](realitykit/lowlevelrendercontext/makemeshpart(resource:indexoffset:indexcount:primitive:windingorder:bounds:).md)
- [makeMeshInstanceArray(renderTargets:count:)](realitykit/lowlevelrendercontext/makemeshinstancearray(rendertargets:count:).md)
- [makeInstanceTransformResource(instanceCapacity:)](realitykit/lowlevelrendercontext/makeinstancetransformresource(instancecapacity:).md)
