---
title: skybox
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/environmentresource/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).

## Declaration

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

## Discussion

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 cube texture parameter. // 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))) }
