How do I change the background color of a visionOS immersive space?

In visionOS, once an immersive space is opened, the background color is solid black. How do I change this? I just need to set a static color without any shading, but I can't find any documentation or examples on how to do this, and the template that comes with Xcode 15.1 beta 3 doesn't change the background color.

I've searched around for information, but all I can find points back to MTKView.clearColor, which I can't use when drawing into an immersive space, since immersive spaces on visionOS use Compositor Services and not MTKView or CAMetalLayer for drawing 3D content.

I think searching with skybox may help you find your answer, but I’ve never personally done this.

import SwiftUI
import RealityKit
import RealityKitContent
import AVFoundation

struct ImmersiveView: View {
    
    var body: some View {
        RealityView { content in
            
            guard let resource = try? TextureResource.load(named: "Starfield") else {
                fatalError("加载纹理贴图失败")
            }
            var material = UnlitMaterial()
            material.color = .init(texture: .init(resource))
            
            let environment = Entity()
            environment.components.set(ModelComponent(
                mesh: .generateSphere(radius: 1000),
                materials: [material]
            ))
            environment.scale *= .init(x: -1, y: 1, z: 1)
            
            let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in
                let radians = Float.pi / 180.0
                let rotation = simd_quatf(angle: radians, axis: SIMD3<Float>(0,1,0)) /
                environment.move(to: Transform(rotation: rotation), relativeTo: environment, duration: 10, timingFunction: .linear)
            }
            RunLoop.current.add(timer, forMode: .default)
            
            content.add(environment)
        
        }
    }
}
How do I change the background color of a visionOS immersive space?
 
 
Q