<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/LayerRenderer/Frame/monocularFrustumMatrixForDrawableTarget(drawableTarget:convention:viewIndex:increaseTangents:depthRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Compositor Services",
      "CompositorServices"
    ],
    "preciseIdentifier" : "s:So10cp_frame_tV18CompositorServicesE39monocularFrustumMatrixForDrawableTarget08drawableJ010convention9viewIndex16increaseTangents10depthRangeSo13simd_float4x4aSo0a1_K7_targetV_So0a16_axis_direction_L0VSis5SIMD4VySfGs5SIMD2VySfGtF"
  },
  "title" : "monocularFrustumMatrixForDrawableTarget(drawableTarget:convention:viewIndex:increaseTangents:depthRange:)"
}
-->

# monocularFrustumMatrixForDrawableTarget(drawableTarget:convention:viewIndex:increaseTangents:depthRange:)

Returns the transform which can be used for monocular frustum culling for given view. A matrix to convert
between the device coordinate space to normalized device coordinate space
This should be acquired between starting and submitting a frame.
Renderer should not utilize this transform for actual rendering output.

```
func monocularFrustumMatrixForDrawableTarget(drawableTarget: LayerRenderer.Drawable.Target, convention: AxisDirectionConvention = .rightUpBack, viewIndex: Int, increaseTangents: SIMD4<Float>, depthRange: SIMD2<Float>) -> matrix_float4x4
```

## Parameters

`convention`

The coordinate axes convention used.

`increaseTangents`

The requested increased tangents
for computing the projection transform. Values should be positive.

`depthRange`

The requested depth range
for computing the projection transform. Values should be positive.

## Return Value

A perspective projection matrix that transforms coordinates
from view coordinate space to clip space.

## Discussion

The convention is defined in normalized device coordinates, which impact
the rendering direction of rendering but have no impact on the convention
used for model/view space. To convert from view space to the axis direction convention
used by the projection matrix, a rotation/mirror matrix can be applied pre-projection matrix.

The axes are defined as:
• X axes determines the horizontal direction of pixels –
right convention means the left-most pixel is the left of the view
• Y axes determines the vertical direction of pixels –
up convention means the top-most pixel is the top of the view
• Z axes determines the handedness/winding order
The default convention is `rightUpBack`
for CompositorServices and Metal renderers which has a counter-clockwise winding order.

To avoid false positives during culling, transform should have broader tangents and depth range compared to one
will be used for rendering. As the time performing culling becomes more distant from `presentation time`,
renderer should request for wider tangents/depth.

---

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)