Contents

lightingBlendDistance

The distance over which crossing-entity lighting blends between the host scene and the portal world.

Declaration

var lightingBlendDistance: Float { get set }

Discussion

As an entity with PortalCrossingComponent crosses the portal boundary, RealityKit transitions its lighting from the host scene’s environment to the portal world’s environment. This property controls the width, in meters, of that transition:

  • A value of 0 produces a sharp lighting boundary, with the entity fully lit by the portal world on the inside and the host scene on the outside.

  • A positive value produces a smooth gradient that spans the given distance into the portal world, portal crossing entities are unaffected by this value.

The boundary used for the distance calculation is the geometry you configure with crossingMode: a plane for PortalComponent.CrossingMode.plane(_:), or a box for PortalComponent.CrossingMode.volume(_:).