scier / MetalSplatter

Render Gaussian Splats using Metal on Apple platforms (iOS/iPhone/iPad, macOS, and visionOS)
MIT License
239 stars 27 forks source link

How do I switch to mixed mode #15

Closed zxwzxw closed 4 months ago

zxwzxw commented 4 months ago

"How do I switch to mixed mode? Why, after using the code .immersionStyle(selection: .constant(.mixed), in: .mixed), is the background still black when I launch Splat, and I don't see the real environment?"

scier commented 4 months ago

Unfortunately this is an explicit limitation in visionOS: Metal content can only be renderer in full immersion. This is because of the security model, which does most rendering (via RealityKit) out of process and then also composites with the video feed out-of-process, whereas Metal rendering occurs in-process.

It's possible this could be changed in a future release of visionOS (either by allowing Metal content to be composited out-of-process after rendering, or by loosening the security model); but for now, Apple considers it a feature, not a bug.

See https://developer.apple.com/videos/play/wwdc2023/10089

Yang-Xijie commented 4 months ago

related issue: https://github.com/scier/MetalSplatter/issues/4

sam598 commented 3 months ago

VisonOS 2 now supports metal rendering in mixed immersion mode. Would be great to see it added. https://github.com/scier/MetalSplatter/issues/18