<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MeshDeformer",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12MeshDeformerP"
  },
  "title" : "MeshDeformer"
}
-->

# MeshDeformer

An interface for all deformation types in a deformation definition, both built-in and custom.
The users overrides all functions to implement a custom `MeshDeformer`, and can in general ignore
all but the constructors for built-in deformers.

```
protocol MeshDeformer : Decodable, Encodable, Equatable, Sendable
```

## Topics

### Identifying the deformer

[`static var type: String`](/documentation/RealityKit/MeshDeformer/type-swift.type.property)

Provide a unique identifier for type of deformer.
There can only be one `deform` function associated with each type String. However,
each `deform` can vary greatly based on run time options and input.

[`var type: String`](/documentation/RealityKit/MeshDeformer/type-nxsx)

provide a unique identifier for type of deformer, default implementation provided

### Configuring deformation options

[`var options: MeshDeformerOptions`](/documentation/RealityKit/MeshDeformer/options)

provide options for the deformer, default implementation is provided

### Deforming the mesh

[`func deform(parameter: MeshDeformParameterGPU, encoder: any MTLComputeCommandEncoder)`](/documentation/RealityKit/MeshDeformer/deform(parameter:encoder:))

deform the mesh on the GPU (the preferred method)

[`func deform(parameter: MeshDeformParameterCPU)`](/documentation/RealityKit/MeshDeformer/deform(parameter:))

deform the mesh on the CPU (may be useful for debugging), a no-op is allowed, default implementation is provided

### Comparing deformers

[`func isDeformerEqual(other: any MeshDeformer) -> Bool`](/documentation/RealityKit/MeshDeformer/isDeformerEqual(other:))

default implementation is provided

### Instance Properties

[`var mode: MeshDeformerExecutionMode`](/documentation/RealityKit/MeshDeformer/mode-6ci1w)

specify which `deform` function will be called, default implementation is provided

### Type Properties

[`static var mode: MeshDeformerExecutionMode`](/documentation/RealityKit/MeshDeformer/mode-v9mj)

specify which `deform` function will be called, default implementation is provided

## Relationships

### Inherits From

[`Equatable`](/documentation/Swift/Equatable)

[`Decodable`](/documentation/Swift/Decodable)

[`Encodable`](/documentation/Swift/Encodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

### Conforming Types

[`BlendShapeDeformer`](/documentation/RealityKit/BlendShapeDeformer)

[`RenormalizingDeformer`](/documentation/RealityKit/RenormalizingDeformer)

[`BoundingBoxCalculator`](/documentation/RealityKit/BoundingBoxCalculator)

[`SkinningDeformer`](/documentation/RealityKit/SkinningDeformer)

[`SubdivisionSurfaceDeformer`](/documentation/RealityKit/SubdivisionSurfaceDeformer)

---

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)