<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/EnvironmentResource/skybox",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation19EnvironmentResourceC6skyboxAA07TextureD0Cvp"
  },
  "title" : "skybox"
}
-->

# skybox

The cube color texture that contains environment surrounding details, or a low-resolution proxy
of the original skybox if the `EnvironmentResource` was created with `CreateOptions(skyboxMode: .discard)`.

```
@MainActor @preconcurrency var skybox: TextureResource { get }
```

## Discussion

The skybox contains the environment’s detailed surroundings as a cube texture, which you can use to render the background
of a scene.
The skybox texture determines the environment’s lighting.
You can assign the skybox texture to a [`ShaderGraphMaterial`](/documentation/RealityKit/ShaderGraphMaterial) cube texture parameter.

```swift
// Load an environment resource.
let env = try await EnvironmentResource(
    named: environmentResourceName, in: Bundle.main)

// Assign its skybox to a material's cube map texture parameter.
var skyboxCubeMaterial = try await ShaderGraphMaterial(named: materialUSDPath,
                                                       from: sceneResourceName,
                                                       in: contentBundle)
try await skyboxCubeMaterial.setParameter(name: cubeTextureParameterName,
                                          value: .textureResource(env.skybox))
skyboxCubeMaterial.faceCulling = .front

// Apply to a background sky dome sphere.
let skyDome = await ModelEntity(mesh: .generateSphere(radius: 1E3),
                                materials: [skyboxCubeMaterial])

await MainActor.run {
    sceneRootEntity.addChild(skyDome)

    // Also use the environment resource for lighting.
    let probe = VirtualEnvironmentProbeComponent.Probe(environment: env)
    sceneRootEntity.components.set(VirtualEnvironmentProbeComponent(source: .single(probe)))
}
```

---

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)