<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ARView/RenderCallbacks-swift.struct/postProcess",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:10RealityKit6ARViewC15RenderCallbacksV11postProcessyAC04PostG7ContextVcSgvp"
  },
  "title" : "postProcess"
}
-->

# postProcess

A callback function for implementing postprocess effects.

```
var postProcess: ((ARView.PostProcessContext) -> Void)?
```

## Discussion

Assign a function or closure to this property to implement
postprocessing effects for a RealityKit scene. If this value is
non-`nil`, RealityKit calls the assigned function or closure once
every frame before it displays the scene. If you register a
postprocess render callback, the callback function needs to encode the
modified frame buffer to the context’s
[`targetColorTexture`](/documentation/RealityKit/ARView/PostProcessContext/targetColorTexture), or nothing
renders.

A postprocess callback looks like this:

```swift
func myPostProcessCallback(context:ARView.PostProcessContext) {
   // Handle postprocessing here.
}
```

To register the function so RealityKit begins calling it, assign it
to the [`postProcess`](/documentation/RealityKit/ARView/RenderCallbacks-swift.struct/postProcess) property
of the view’s [`renderCallbacks`](/documentation/RealityKit/ARView/renderCallbacks-swift.property) property.

```swift
arView.renderCallbacks.postProcess = myPostProcessCallback
```

To stop RealityKit from calling your function, assign `nil`:

```swift
arView.renderCallbacks.postProcess = nil
```

If your app turns postprocessing on and off frequently, another
option for disabling postprocess effects is to keep your callback
registered, but use an
<doc://com.apple.documentation/documentation/Metal/MTLBlitCommandEncoder>
to encode the unmodified frame directly to the output texture
whenever postprocess effects aren’t active.

```swift
func myPostProcessCallback(context:ARView.PostProcessContext) {
    if (usePostProcessEffects) {
        handlePostProcessing(context: ARView.PostProcessContext)
        return
    }

    // If postprocess effects are disabled, copy sourceColorTexture
    // directly to targetColorTexture.
    let blitEncoder = context.commandBuffer.makeBlitCommandEncoder()
    blitEncoder?.copy(from: context.sourceColorTexture, to: context.targetColorTexture)
    blitEncoder?.endEncoding()
}
```

---

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)