Posts

Post not yet marked as solved
0 Replies
170 Views
Hey, I'm wondering what would be the proper way to add RealityView content asynchronously, while doing the heavy lifting in a background thread. My use case is that I am generating procedural geometry which takes a few seconds to complete. Meanwhile I would like the UI to show other geometry / UI elements and the Main thread to be responsive. Basically what I would like to do, in pseudocode, is: runInBackgroundThread { let geometry = generateGeometry() // CPU intensive, takes 1-2 s let entity = createEntity(geometry) // CPU intensive, takes ~1 s let material = try! await ShaderGraphMaterial(..) entity.model!.materials = [material] runInMainThread { addToRealityViewContent(entity) } } With this I am running into so many issues with especially the material, which apparently cannot be constructed on a non-main thread and cannot be passed over thread borders.
Posted
by matti777.
Last updated
.
Post not yet marked as solved
1 Replies
137 Views
Hey, as it would seem that PerspectiveCamera (https://developer.apple.com/documentation/realitykit/perspectivecamera) is available for VisionOS 1.0+, I was wondering if there is any way of accessing it and its PerspectiveCameraComponent in order to set the near / far clipping planes for a fully immersive application?
Posted
by matti777.
Last updated
.