Hi! Now I am making a visionOS program. I have an idea that I want to embed spatial videos or pictures into my UI, but now I have encountered problems and have no way to implement my idea. I have tried the following work:
- Use
AVPlayerViewController
to play a spatial video, but it is only display spatial video whenmodalPresentationStyle =.fullscreen
. Once embedded in swiftUI's view, it shows it as a normal 2D image. - The method of
https://developer.apple.com/forums/thread/733813
I also tried, using a shadergraph to realize the function of the spatial images displaying, but the material can only be attached on the entity, I don't know how to make it show up in view. - I also tried to use
CAMetalLayer
to implement this function and write a custom shader to display spatial images, but I couldn't find a function likeunity_StereoEyeIndex
in unity to render binocular switching.
Does anyone have a good solution to my problem? Thank you!