<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4RenderCommandEncoder/setDepthBias(_:slopeScale:clamp:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTL4RenderCommandEncoder(im)setDepthBias:slopeScale:clamp:"
  },
  "title" : "setDepthBias(_:slopeScale:clamp:)"
}
-->

# setDepthBias(_:slopeScale:clamp:)

Configures the adjustments a render pass applies to depth values from fragment shader functions
by a scaling factor and bias.

```
func setDepthBias(_ depthBias: Float, slopeScale: Float, clamp: Float)
```

## Parameters

`depthBias`

A constant bias the render pipeline applies to all fragments.

`slopeScale`

A bias coefficient that scales with the depth of the primitive relative to the camera.

`clamp`

A value that limits the bias value the render pipeline can apply to a fragment.
Pass a positive or negative value to limit the largest magnitude of a positive
or negative bias, respectively. Set this value to `0` to disable bias clamping.

---

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)