---
title: writesDepth
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/simplematerial/writesdepth
---

# writesDepth

A boolean value that determines whether this material writes its depth into RealityKit’s depth buffer.

## Declaration

```swift
var writesDepth: Bool { get set }
```

## Discussion

Discussion If true, meshes with this material will occlude objects behind them by writing their depth into RealityKit’s depth buffer. If false, meshes with this material will not write their depth into RealityKit’s depth buffer, and may be overwritten by objects drawn behind them, depending on draw order. The default value is true.
