I'm trying to load up a virtual skybox, different from the built-in default, for a simple macOS rendering of RealityKit content.
I was following the detail at https://developer.apple.com/documentation/realitykit/environmentresource, and created a folder called "light.skybox" with a single file in it ("prairie.hdr"), and then I'm trying to load that and set it as the environment on the arView when it's created:
let ar = ARView(frame: .zero)
do {
let resource = try EnvironmentResource.load(named: "prairie")
ar.environment.lighting.resource = resource
} catch {
print("Unable to load resource: \(error)")
}
The loading always fails when I launch the sample app, reporting "Unable to load resource ..." and when I look in the App bundle, the resource that's included there as Contents/Resources/light.realityenv is an entirely different size - appearing to be the default lighting.
I've tried making the folder "light.skybox" explicitly target the app bundle for inclusion, but I don't see it get embedded with it toggle that way, or just default.
Is there anything I need to do to get Xcode to process and include the lighting I'm providing?
(This is inspired from https://stackoverflow.com/questions/77332150/realitykit-how-to-disable-default-lighting-in-nonar-arview, which shows an example for UIKit)