<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/RenderLayer",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation11RenderLayerV"
  },
  "title" : "RenderLayer"
}
-->

# RenderLayer

A named identifier for a group of meshes and lights.

```
struct RenderLayer
```

## Overview

Use a [`RenderLayer`](/documentation/RealityKit/RenderLayer) to associate a light with the entities it should illuminate,
or to mark which entities a light affects. Every entity belongs to [`defaultLayer`](/documentation/RealityKit/RenderLayer/defaultLayer)
unless its [`RenderLayerComponent`](/documentation/RealityKit/RenderLayerComponent) specifies otherwise.

Define your own layers as static constants in an extension so they’re easy to reuse:

```swift
extension RenderLayer {
    static let hero = RenderLayer("com.myapp.hero")
    static let background = RenderLayer("com.myapp.background")
}
```

## Topics

### Accessing default layers

[`static var defaultLayer: RenderLayer`](/documentation/RealityKit/RenderLayer/defaultLayer)

The default layer.

### Grouping render layers

[`struct Set`](/documentation/RealityKit/RenderLayer/Set)

An unordered collection of unique render layers.

### Initializers

[`init(StaticString)`](/documentation/RealityKit/RenderLayer/init(_:))

Creates a custom render layer with the specified compile-time constant name.

[`init?(rawValue: String)`](/documentation/RealityKit/RenderLayer/init(rawValue:))

Creates a custom render layer with the specified runtime name.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Copyable`](/documentation/Swift/Copyable)

[`Hashable`](/documentation/Swift/Hashable)

[`Escapable`](/documentation/Swift/Escapable)

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)