One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

SpotLightComponent.Shadow

struct · iOS 13.0+ · SDK 27.1

struct Shadow

A spotlight component that adds shadows to entities that it illuminates.

Members (16)

get · iOS 18.0+

cullModeOverride

TypeScript
get cullModeOverride(): (MaterialParameterTypes_FaceCulling) | null
Swift declaration
var cullModeOverride: SpotLightComponent.Shadow.ShadowMapCullMode? { get set }

The light's culling mode for shadow map rendering.

set · iOS 18.0+

cullModeOverride

TypeScript
set cullModeOverride(value: (MaterialParameterTypes_FaceCulling) | null)
Swift declaration
var cullModeOverride: SpotLightComponent.Shadow.ShadowMapCullMode? { get set }

The light's culling mode for shadow map rendering.

get · iOS 18.0+

zFar

TypeScript
get zFar(): SpotLightComponent_Shadow_ShadowClippingPlane
Swift declaration
var zFar: SpotLightComponent.Shadow.ShadowClippingPlane { get set }

The orthogonal plane of the shadow frustum that's furthest from the spotlight. The `zFar` is the maximum distance between the light and a visible surface for casting shadows. The spotlight applies the value from ``SpotLightComponent/attenuationRadius``, when you set this property to ``ShadowClippingPlane/automatic``, which is its default value. Setting this value to ``ShadowClippingPlane/fixed(_:)`` is equivalent to assigning it to `min(zFar, attenuationRadius)`.

set · iOS 18.0+

zFar

TypeScript
set zFar(value: SpotLightComponent_Shadow_ShadowClippingPlane)
Swift declaration
var zFar: SpotLightComponent.Shadow.ShadowClippingPlane { get set }

The orthogonal plane of the shadow frustum that's furthest from the spotlight. The `zFar` is the maximum distance between the light and a visible surface for casting shadows. The spotlight applies the value from ``SpotLightComponent/attenuationRadius``, when you set this property to ``ShadowClippingPlane/automatic``, which is its default value. Setting this value to ``ShadowClippingPlane/fixed(_:)`` is equivalent to assigning it to `min(zFar, attenuationRadius)`.

get · iOS 18.0+

zNear

TypeScript
get zNear(): SpotLightComponent_Shadow_ShadowClippingPlane
Swift declaration
var zNear: SpotLightComponent.Shadow.ShadowClippingPlane { get set }

The near-plane of a shadow frustum. The `zNear` is the minimum distance between the light and a visible surface for casting shadows. The default value for `zNear` is ``ShadowClippingPlane/automatic``.

set · iOS 18.0+

zNear

TypeScript
set zNear(value: SpotLightComponent_Shadow_ShadowClippingPlane)
Swift declaration
var zNear: SpotLightComponent.Shadow.ShadowClippingPlane { get set }

The near-plane of a shadow frustum. The `zNear` is the minimum distance between the light and a visible surface for casting shadows. The default value for `zNear` is ``ShadowClippingPlane/automatic``.

get · iOS 27.0+

layers

TypeScript
get layers(): (RenderLayer_Set) | null
Swift declaration
var layers: RenderLayer.Set? { get set }

The layers of entities that cast shadows from this light. An entity casts a shadow into this light's shadow map when the layers of its ``RenderLayerComponent`` intersect with this set. Set this property to: - `nil` (the default) to inherit ``SpotLightComponent/layers``, so any entity the light illuminates can also cast a shadow from it. - An empty set to disable shadow casting from this light entirely. Shadow casting can be restricted by layer on devices with Apple6 GPU family feature support.

set · iOS 27.0+

layers

TypeScript
set layers(value: (RenderLayer_Set) | null)
Swift declaration
var layers: RenderLayer.Set? { get set }

The layers of entities that cast shadows from this light. An entity casts a shadow into this light's shadow map when the layers of its ``RenderLayerComponent`` intersect with this set. Set this property to: - `nil` (the default) to inherit ``SpotLightComponent/layers``, so any entity the light illuminates can also cast a shadow from it. - An empty set to disable shadow casting from this light entirely. Shadow casting can be restricted by layer on devices with Apple6 GPU family feature support.

init · iOS 27.0+

init

TypeScript
static initLayers(layers?: (RenderLayer_Set) | null): SpotLightComponent_Shadow
Swift declaration
init(layers: RenderLayer.Set? = nil)

Creates a spot light shadow that accepts shadow casters from the specified layers. - Parameter layers: The layers of entities that cast shadows from this light. Pass `nil` (the default) to inherit ``SpotLightComponent/layers``, or an empty set to disable shadow casting entirely.

get · iOS 27.0+

quality

TypeScript
get quality(): SpotLightComponent_Shadow_QualityMode
Swift declaration
var quality: SpotLightComponent.Shadow.QualityMode { get set }

The shadow-filtering algorithm this light uses. Set to ``QualityMode/medium`` or ``QualityMode/high`` to opt the light into soft shadows, whose penumbra widens with ``lightSize`` and with the distance between the caster and the receiving surface. The default value is ``QualityMode/low``, which produces a hard-edged shadow whose appearance is independent of ``lightSize``. Higher quality modes use more samples per shadow, which increases GPU work. Excessive use of higher shadow quality lights may contribute to user-noticeable frame drops and can cause the device to heat up in graphically demanding scenes. Monitor the thermal state to lower quality as a mitigation, if necessary. Apps can monitor thermal state changes by subscribing to the [thermalStateDidChange](https://developer.apple.com/documentation/foundation/notificationcenter/messageidentifier/thermalstatedidchange) notification. To stay responsive to the device's available thermal headroom, read `ProcessInfo.processInfo.thermalState` and observe `ProcessInfo.thermalStateDidChangeNotification` to react when it changes. As the reported state moves from `.fair` toward `.serious` and `.critical` switch the light to a lower quality.

set · iOS 27.0+

quality

TypeScript
set quality(value: SpotLightComponent_Shadow_QualityMode)
Swift declaration
var quality: SpotLightComponent.Shadow.QualityMode { get set }

The shadow-filtering algorithm this light uses. Set to ``QualityMode/medium`` or ``QualityMode/high`` to opt the light into soft shadows, whose penumbra widens with ``lightSize`` and with the distance between the caster and the receiving surface. The default value is ``QualityMode/low``, which produces a hard-edged shadow whose appearance is independent of ``lightSize``. Higher quality modes use more samples per shadow, which increases GPU work. Excessive use of higher shadow quality lights may contribute to user-noticeable frame drops and can cause the device to heat up in graphically demanding scenes. Monitor the thermal state to lower quality as a mitigation, if necessary. Apps can monitor thermal state changes by subscribing to the [thermalStateDidChange](https://developer.apple.com/documentation/foundation/notificationcenter/messageidentifier/thermalstatedidchange) notification. To stay responsive to the device's available thermal headroom, read `ProcessInfo.processInfo.thermalState` and observe `ProcessInfo.thermalStateDidChangeNotification` to react when it changes. As the reported state moves from `.fair` toward `.serious` and `.critical` switch the light to a lower quality.

get · iOS 18.0+

depthBias

TypeScript
get depthBias(): number
Swift declaration
var depthBias: Float { get set }

A constant value that RealityKit applies as a bias to its shadow calculations. Reduce visual effects such as _shadow acne_, by adjusting this property. The default value is `1.0`.

set · iOS 18.0+

depthBias

TypeScript
set depthBias(value: number)
Swift declaration
var depthBias: Float { get set }

A constant value that RealityKit applies as a bias to its shadow calculations. Reduce visual effects such as _shadow acne_, by adjusting this property. The default value is `1.0`.

get · iOS 27.0+

lightSize

TypeScript
get lightSize(): number
Swift declaration
var lightSize: Float { get set }

The radius of the spotlight's emitting surface, in meters. Larger values widen the penumbra and lengthen the transition between fully-shadowed and fully-lit regions, approximating the way an area light of that radius would shade a scene. The default value is `0.1`. This property has no effect when ``quality`` is ``QualityMode/low``, which always produces a hard-edged shadow.

set · iOS 27.0+

lightSize

TypeScript
set lightSize(value: number)
Swift declaration
var lightSize: Float { get set }

The radius of the spotlight's emitting surface, in meters. Larger values widen the penumbra and lengthen the transition between fully-shadowed and fully-lit regions, approximating the way an area light of that radius would shade a scene. The default value is `0.1`. This property has no effect when ``quality`` is ``QualityMode/low``, which always produces a hard-edged shadow.

init · iOS 13.0+

init

TypeScript
static init(): SpotLightComponent_Shadow
Swift declaration
init()

Creates a new spot light shadow object.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →