---
title: GroundingShadowComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/groundingshadowcomponent
---

# GroundingShadowComponent

A component that controls an entity’s grounding shadow.

## Declaration

```swift
struct GroundingShadowComponent
```

## Overview

Overview A grounding shadow is an effect that makes an entity look like it has a light source directly above it. You can add a grounding shadow to any entity that has a ModelComponent in its component set by adding a grounding shadow component to the entity’s components property. if let model = try? await ModelEntity(named: "tv_retro") {     let shadowComponent = GroundingShadowComponent(castsShadow: true)     model.components.set(shadowComponent) }  |   |  You need to add the grounding shadow component to each entity you want to apply the effect to, because the grounding shadow component doesn’t apply to hierarchies. note: Neither virtual nor physical light sources affect grounding shadows. Receiving Shadows By default, all entity models with a grounding shadow component can cast a shadow onto any other model entities in the scene. However, you can configure an entity to opt out of receiving shadows from other entities by setting a grounding shadow component’s receivesShadow property to false and adding that component to the entity that’s opting out. let tvShadow = GroundingShadowComponent(castsShadow: true) tvShadow.receivesShadow = false tv.components.set(tvShadow) Alternatively, you can create a new grounding shadow component instance that opts out of receiving shadows by passing false to the receivesShadow parameter of the init(castsShadow:receivesShadow:) initializer. let robotShadow = GroundingShadowComponent(castsShadow: true,                                            receivesShadow: false) robot.components.set(robotShadow)  |   |  RealityKit generates grounding shadows from the perspective of another entity that receives the first entity’s shadow. One-sided geometry only casts a shadow if its facets face the entity that receives the shadow, which typically means they face downward. Make each 2D object cast a grounding shadow by applying a material that disables face culling, or by replacing it with a watertight mesh.

## Topics

### Initializers

- [init(castsShadow:)](realitykit/groundingshadowcomponent/init(castsshadow:).md)
- [init(castsShadow:receivesShadow:)](realitykit/groundingshadowcomponent/init(castsshadow:receivesshadow:).md)
- [init(castsShadow:receivesShadow:fadeBehaviorNearPhysicalObjects:)](realitykit/groundingshadowcomponent/init(castsshadow:receivesshadow:fadebehaviornearphysicalobjects:).md)

### Instance Properties

- [castsShadow](realitykit/groundingshadowcomponent/castsshadow.md)
- [fadeBehaviorNearPhysicalObjects](realitykit/groundingshadowcomponent/fadebehaviornearphysicalobjects-swift.property.md)
- [receivesShadow](realitykit/groundingshadowcomponent/receivesshadow.md)

### Enumerations

- [GroundingShadowComponent.FadeBehaviorNearPhysicalObjects](realitykit/groundingshadowcomponent/fadebehaviornearphysicalobjects-swift.enum.md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)

## See Also

### General shadows

- [DynamicLightShadowComponent](realitykit/dynamiclightshadowcomponent.md)
