<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation25DirectionalLightComponentV6ShadowV"
  },
  "title" : "DirectionalLightComponent.Shadow"
}
-->

# DirectionalLightComponent.Shadow

A directional light component that adds shadows to entities that it illuminates

```
struct Shadow
```

## Topics

### Creating the shadow

[`init()`](/documentation/RealityKit/DirectionalLightComponent/Shadow/init())

Creates a directional light shadow using default values.

[`init(shadowProjection: DirectionalLightComponent.Shadow.ShadowProjectionType, depthBias: Float, cullMode: DirectionalLightComponent.Shadow.ShadowMapCullMode?)`](/documentation/RealityKit/DirectionalLightComponent/Shadow/init(shadowProjection:depthBias:cullMode:))

Creates a directional light shadow with a shadow projection, depth bias and cull mode.

[`init(maximumDistance: Float, depthBias: Float)`](/documentation/RealityKit/DirectionalLightComponent/Shadow/init(maximumDistance:depthBias:))

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

[`init(layers: RenderLayer.Set?)`](/documentation/RealityKit/DirectionalLightComponent/Shadow/init(layers:))

Creates a directional light shadow that accepts shadow casters from the specified layers.

### Configuring the shadow

[`var depthBias: Float`](/documentation/RealityKit/DirectionalLightComponent/Shadow/depthBias)

A constant value that RealityKit applies as a bias to its shadow calculations.

[`var cullModeOverride: DirectionalLightComponent.Shadow.ShadowMapCullMode?`](/documentation/RealityKit/DirectionalLightComponent/Shadow/cullModeOverride)

The light’s culling mode for shadow map rendering.

[`var shadowProjection: DirectionalLightComponent.Shadow.ShadowProjectionType`](/documentation/RealityKit/DirectionalLightComponent/Shadow/shadowProjection)

Sets the shadow projection used for shadow map rendering

[`var maximumDistance: Float`](/documentation/RealityKit/DirectionalLightComponent/Shadow/maximumDistance)

The maximum distance for the shadow.

### Specifying affected layers

[`var layers: RenderLayer.Set?`](/documentation/RealityKit/DirectionalLightComponent/Shadow/layers)

The layers of entities that cast shadows from this light.

### Configuring shadow cascades

[`var cascades: DirectionalLightComponent.Shadow.Cascades`](/documentation/RealityKit/DirectionalLightComponent/Shadow/cascades-swift.property)

Number of shadow cascades to use when rendering shadows for this light.

[`struct Cascades`](/documentation/RealityKit/DirectionalLightComponent/Shadow/Cascades-swift.struct)

### Type Aliases

[`typealias ShadowMapCullMode`](/documentation/RealityKit/DirectionalLightComponent/Shadow/ShadowMapCullMode)

### Enumerations

[`enum ShadowProjectionType`](/documentation/RealityKit/DirectionalLightComponent/Shadow/ShadowProjectionType)

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Component`](/documentation/RealityKit/Component)

---

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)