<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PostProcessEffect/postProcess(context:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17PostProcessEffectP04postD07contextyAA0cdE7ContextVySo16MTLCommandBuffer_pG_tF"
  },
  "title" : "postProcess(context:)"
}
-->

# postProcess(context:)

A method where you can implement postprocess effects.

```
nonisolated mutating func postProcess(context: borrowing PostProcessEffectContext<any MTLCommandBuffer>)
```

## Discussion

RealityKit calls this method after rendering the main scene,
but before it is drawn on the screen, ideal for performing
screen-space effects or drawing overlays.

When registering a post processing effect,
the callback function needs to encode the modified frame buffer to the context’s
[`targetColorTexture`](/documentation/RealityKit/PostProcessEffectContext/targetColorTexture),
or nothing renders.

An empty implementation might look like this, which copies the
[`sourceColorTexture`](/documentation/RealityKit/PostProcessEffectContext/sourceColorTexture) directly to the
[`targetColorTexture`](/documentation/RealityKit/PostProcessEffectContext/targetColorTexture):

```swift
func postProcess(context: borrowing PostProcessEffectContext<MTLCommandBuffer>) {
    // Post processing with no effect.
    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)