---
title: "setDepthBias(_:slopeScale:clamp:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/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.

## Declaration

```swift
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.

## See Also

### Configuring depth and stencil behavior

- [setDepthStencilState(_:)](metal/mtl4rendercommandencoder/setdepthstencilstate(_:).md)
- [setDepthClipMode(_:)](metal/mtl4rendercommandencoder/setdepthclipmode(_:).md)
- [setDepthTestBounds(_:)](metal/mtl4rendercommandencoder/setdepthtestbounds(_:).md)
- [setStencilReferenceValue(_:)](metal/mtl4rendercommandencoder/setstencilreferencevalue(_:).md)
- [setStencilReferenceValue(front:back:)](metal/mtl4rendercommandencoder/setstencilreferencevalue(front:back:).md)
