Hello, thank you again for pointing me to the Gaussian splats on visionOS sample and suggesting the workflow of loading PLY data into GaussianSplatResource.BufferResource, attaching it to a GaussianSplatComponent, and then saving the Entity using write(to:).
I followed this workflow on macOS 27 Beta with Xcode 27 Beta, and I can successfully render the Gaussian splat at runtime. However, I am encountering an issue when saving and reloading the Reality File.
My workflow is:
PLY
→ parse 85,050 Gaussian splats
→ LowLevelBuffer
→ GaussianSplatResource.BufferResource
→ GaussianSplatResource
→ GaussianSplatComponent
→ Entity
→ Entity.write(to:)
→ .reality
The runtime rendering works correctly, and I can see all 85,050 splats in RealityView.
However, after calling:
try await entity.write(to: url)
the resulting .reality file is only 4,619 bytes.
I then reload it with:
let entity = try await Entity.load(contentsOf: url)
The Entity loads successfully and retains its name, but the reloaded Entity no longer contains a GaussianSplatComponent.
I also see these messages during loading:
Failed to set dependencies on asset 14319052529245013681 because NetworkAssetManager does not have an asset entity for that id.
Failed to set dependencies on asset 17573982531972126889 because NetworkAssetManager does not have an asset entity for that id.
The important part is that the original runtime Entity definitely contains the Gaussian splat and renders correctly before write(to:), but the reloaded Entity does not contain the GaussianSplatComponent.
I have also tried writing the Entity using the static:
try await Entity.write([entity], to: url)
but the resulting Reality File is similarly very small and the Gaussian splat data is not restored after loading.
So I would like to clarify something about the workflow you mentioned:
-
Is GaussianSplatResource.BufferResource currently expected to be serializable by Entity.write(to:) into a .reality file?
-
Does GaussianSplatResource created from a BufferResource require some additional asset/resource registration step before calling Entity.write(to:)?
-
Since GaussianSplatResource references the underlying LowLevelBuffer, is the underlying LowLevelBuffer data expected to be embedded into the Reality File automatically by write(to:), or does the developer need to persist the splat buffer separately?
-
Is this behavior a current limitation/bug of the Gaussian Splat APIs in macOS 27 / RealityKit Beta?
-
If the workflow described in your previous answer is expected to work, could you point me to the specific part of the Gaussian splats on visionOS sample that demonstrates saving a GaussianSplatComponent created from a BufferResource to a Reality File and then loading that Reality File back with the Gaussian splat data intact?
For reference, the relevant runtime state in my test is:
Gaussian count: 85,050
Buffer stride: 92 bytes
Raw Gaussian data: 7,824,600 bytes
Runtime:
GaussianSplatResource.BufferResource: valid
GaussianSplatComponent: valid
RealityView rendering: works correctly
After Entity.write(to:):
.reality file size: 4,619 bytes
After Entity.load():
Entity: loaded successfully
GaussianSplatComponent: missing
Gaussian splat: not restored
I would especially appreciate clarification on whether a GaussianSplatResource.BufferResource backed by LowLevelBuffer is supposed to be persisted by Entity.write(to:).
Thank you!