<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/DirectionalLightComponent/Shadow/init(maximumDistance:depthBias:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation25DirectionalLightComponentV6ShadowV15maximumDistance9depthBiasAESf_Sftcfc"
  },
  "title" : "init(maximumDistance:depthBias:)"
}
-->

# init(maximumDistance:depthBias:)

Creates a directional light shadow with a maximum distance and depth
bias.

```
init(maximumDistance: Float = 5.0, depthBias: Float = 1.0)
```

## Parameters

`maximumDistance`

The maximum distance for the shadow.

`depthBias`

The depth bias for the shadow.

## Discussion

The `maximumDistance` parameter in this initializer
is equivalent to setting [`shadowProjection`](/documentation/RealityKit/DirectionalLightComponent/Shadow/shadowProjection) to
`.automatic(maximumDistance: maximumDistance)`.

---

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)