<!--
{
  "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/PostProcessContext/init(_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:10RealityKit6ARViewC18PostProcessContextVyAESo9MTLDevice_p_So16MTLCommandBuffer_pSo10MTLTexture_pSoAH_pSoAH_pSo13simd_float4x4aSdtcfc"
  },
  "title" : "init(_:_:_:_:_:_:_:)"
}
-->

# init(_:_:_:_:_:_:_:)

Creates a new context object.

```
init(_ device: any MTLDevice, _ commandBuffer: any MTLCommandBuffer, _ sourceColorTexture: any MTLTexture, _ sourceDepthTexture: any MTLTexture, _ targetColorTexture: any MTLTexture, _ projection: float4x4, _ time: TimeInterval)
```

## Parameters

`device`

The Metal device the view renders to.

`commandBuffer`

The Metal command buffer that encodes this view.

`sourceColorTexture`

A texture containing the rendered frame.

`sourceDepthTexture`

A texture containing the frame’s depth buffer.

`targetColorTexture`

A texture the callback function writes to.

`projection`

The projection matrix for this frame.

`time`

The current elapsed time.

## Discussion

This initializer creates a new postprocess context object.
RealityKit creates context objects and passes them to the
postprocess render callback. Your code won’t usually need to create
context objects directly.

---

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)