Are dynamic lights possible with RealityKit

Asked on 07/29/2024

1 search

Yes, dynamic lights are possible with RealityKit. You can use different types of lights such as spotlights, directional lights, and point lights. Spotlights and directional lights can cast shadows by default, and you can customize their color and intensity. You can add these lights and shadows either through Swift API in code or through Reality Composer Pro, which offers a UI for tuning lighting behavior.

For example, you can attach a spotlight to an entity, configure its properties like color, intensity, and attenuation radius, and even add a shadow component to it. This allows objects lit by dynamic spotlights and directional lights to cast shadows by default. If you don't want some objects to cast shadows, you can add a dynamic light shadow component to them and set cast shadow to false.

For more details, you can refer to the session Discover RealityKit APIs for iOS, macOS and visionOS.

Relevant Sessions

  1. Discover RealityKit APIs for iOS, macOS and visionOS
  2. Build a spatial drawing app with RealityKit