<!--
{
  "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/DirectionalLight",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation16DirectionalLightC"
  },
  "title" : "DirectionalLight"
}
-->

# DirectionalLight

An entity that casts a virtual light in a particular direction.

```
@MainActor @preconcurrency class DirectionalLight
```

## Overview

During an AR session, RealityKit automatically lights your virtual objects
to match real-world lighting.
You can also explicitly add virtual lights that act upon your virtual content.
This is typically most useful outside of an AR session on iOS or macOS,
where your [`RealityViewCameraContent`](/documentation/RealityKit/RealityViewCameraContent) [`camera`](/documentation/RealityKit/RealityViewCameraContent/camera)
property is set to [`virtual`](/documentation/RealityKit/RealityViewCamera/virtual).

A directional light uniformly casts light along its local z-axis—specifically,
along `[0, 0, -1]`.
This is equivalent to creating an [`Entity`](/documentation/RealityKit/Entity), and then adding
a [`DirectionalLightComponent`](/documentation/RealityKit/DirectionalLightComponent) to its [`components`](/documentation/RealityKit/Entity/components) set.
Use the light’s [`look(at:from:upVector:relativeTo:)`](/documentation/RealityKit/HasTransform/look(at:from:upVector:relativeTo:))
method to aim the light in a particular direction.

You can configure the light’s color and intensity with the component properties
in [`light`](/documentation/RealityKit/HasDirectionalLight/light).
You can also control how or if it casts a [`shadow`](/documentation/RealityKit/HasDirectionalLight/shadow).

A RealityKit scene can contain up to eight dynamic lights, which are
entities that contain a
[`SpotLightComponent`](/documentation/RealityKit/SpotLightComponent), [`PointLightComponent`](/documentation/RealityKit/PointLightComponent), or a [`DirectionalLightComponent`](/documentation/RealityKit/DirectionalLightComponent).
This limit doesn’t include light from image-based lighting.

Devices that support `MTLGPUFamily.apple6` or later lift this limit, so a scene can
contain many more dynamic lights.

## Topics

### Creating a directional light

[`init()`](/documentation/RealityKit/DirectionalLight/init())

Creates a new entity.



---

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)