---
title: OcclusionMaterial
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/occlusionmaterial
---

# OcclusionMaterial

An invisible material that hides objects rendered behind it.

## Declaration

```swift
struct OcclusionMaterial
```

## Overview

Overview Add an OcclusionMaterial to a model by setting it as one of the materials in a ModelComponent. let model = ModelComponent(     mesh: .generateBox(size: 1),     materials: [OcclusionMaterial()] ) smallBoxEntity.components.set(model) For example, on the left is a case of two cubes, the larger red cube is slightly further from the camera and has a simple material. The slightly smaller and closer cube has no material in the left image and an occlusion material on the right image.  |   |

## Topics

### Creating an occlusion material

- [init(receivesDynamicLighting:)](realitykit/occlusionmaterial/init(receivesdynamiclighting:).md)
- [init()](realitykit/occlusionmaterial/init().md)

### Receiving dynamic lighting

- [receivesDynamicLighting](realitykit/occlusionmaterial/receivesdynamiclighting.md)

### Setting depth testing properties

- [readsDepth](realitykit/occlusionmaterial/readsdepth.md)

### Instance Properties

- [faceCulling](realitykit/occlusionmaterial/faceculling-swift.property.md)

### Type Aliases

- [OcclusionMaterial.FaceCulling](realitykit/occlusionmaterial/faceculling-swift.typealias.md)

## Relationships

### Conforms To

- [Material](realitykit/material.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Object occlusion

- [Obscuring virtual items in a scene behind real-world items](visionos/obscuring-virtual-items-in-a-scene-behind-real-world-items.md)
- [OcclusionMaterial.FaceCulling](realitykit/occlusionmaterial/faceculling-swift.typealias.md)
