Closed Yang-Xijie closed 6 months ago
a post rather related: https://discussions.unity.com/t/show-passthrough-camera-feed-in-virtual-reality-fully-immersive-app/337732
It seems that visionOS doesn't support passthrough video when using CompositorLayer currently...
I'd love to support rendering with passthrough video (i.e. not just in a full immersive space), but as you've found, that's impossible on visionOS 1.0 (or 1.1). The reason for this is explicit privacy restrictions: Apple doesn't want apps to be able to access the passthrough video. Moreover, it's driven by the basic technical architecture of visionOS created to enforce this policy: rendering normally takes place out-of-process (through RealityKit's purpose-built rendering engine), and passthrough video (or gaze data or other privacy-sensitive information) is never even sent into the app's process. However, Metal rendering needs to occur in-process.
It seems possible that someday Apple might send the results of the Metal render pass out of process for compositing. When that happens I'd love to implement this! In the meantime, we're stuck with the full immersive space, because RealityKit's renderer definitely isn't built to be flexible enough to render gaussian splats.
Thanks for your reply!
Oh, I'll also add -- I interpreted this issue as visionOS-specific, and so is my response. Rendering over passthrough on an iPhone via ARKit does not have these limitations, and should in theory be possible (may require tweaks to the library in theory, e.g. to the stored alpha values)
Hi, thanks for creating this repo!
I'm curious about showing ply model with passthrough video. Currently, the sample app in this repo and the app uploaded to App Store don't support passthrough video. With passthrough video, it will be safer to walk around in a scene model and it will be easier to put an object model on the desk.
However, as mentioned in https://developer.apple.com/documentation/visionos/creating-fully-immersive-experiences :
And, as mentioned in https://developer.apple.com/documentation/compositorservices/drawing_fully_immersive_content_using_metal :
I wonder if you have any idea on rendering both gaussian splatting model with Metal and passthrough video... My simple idea is to add stereo passthrough video as the background if the opacity doesn't reach 1.0 (pixel color = color accumulated + (1 - opacity) * passthrough video color). Do you think this is feasible?