Post

Replies

Boosts

Views

Activity

StoreKit 2 demo buy buttons flips state
I've been playing with Apple's StoreKit 2 demo code (buying the cars, subscriptions, ...), and sometimes when I purchase a car, one or more of the other buttons visually flip state (e.g., purchased checkmark changes back to the price). Leaving the StoreView and returning to it shows the correct state for each of the buttons. I am using the StoreKit Configuration Products.storekit (for the scheme), so testing in Xcode. I get this in both the simulator and on my actual phone. The issue is random. The vast majority of the time everything works perfectly. Is anyone else seeing this issue? Does anyone know how to address it? Dev environment: Xcode 13.0 beta 5 (13A5212g) macOS 12.0 Beta (21A5534d) Mac mini (M1, 2020)
1
0
802
Oct ’21
Guidance on USDZ model sizes
I'm looking for documentation/guidance on USDZ and scene model sizes. My focus is on RealityKit-based apps. I found the 2018 WWDC presentation Integrating Apps and Content with AR Quick Look which mentions a rule of thumb for a USDZ model of: 100K polygons One set of 2048x2048 textures 10 seconds of animations Are these number still recommended in 2021? Are these numbers just for Quicklook, or do they apply to RealityKit-based apps too? If a RealityKit scene loads several USDZ models, should the cumulative number of polygons across all models be 100K, or is the 100K number on a per-model basis? The talk mentioned AR Quicklook will dynamically downsample textures for devices with less memory. Does RealityKit do this as well? If so, can I error on providing a larger texture (e.g., 4096 x 4096) and trust RealityKit to downsample as appropriate for me? (I am hoping there is some documentation covering questions like this)
1
0
2k
Nov ’21
Are RealityKit lights expensive?
I am finding some unexpected behavior with lights I've been adding to a RealityKit scene. For example, I created 14 PointLights, but only 8 appeared to be used to illuminate the scene. In another example, I created 7 PointLights and 7 SpotLights, and the frame rate dropped quite a bit. Are lights computationally expensive, causing some adaptive behavior by RealityKit? Should I be judicious in my use of lights for a scene? (Note: I set arView.environment.lighting.resource to a Skybox with a black image; my goal was to completely control the lighting. I don't know if that added to the computational load)
1
1
1.2k
Dec ’21
Setting lensPosition to focus at infinity
I am creating a fixed-focus camera app with the focus distance at infinity (or at least 30+ feet away). When I set lensPosition to 1.0, the images were blurry. Some tests letting autofocus do the job showed a lensPosition of about 0.808 for my wide and telephoto lenses and 0.84 for the ultra wide lens did the trick. (iPhone 13 Max) Will the lensPosition to focus at infinity vary between devices and lenses on that device? Is there a way to determine the appropriate lensPosition at run time?
1
0
894
May ’22
AnchorEntity from ARAnchor bug?
I am running into a strange bug where the exact same code compiles fine in one project but generates a compiler error in another project. In particular, I am trying to create an AnchorEnity from an ARAnchor. func addModelTo(anchor: ARAnchor) { let entityAnchor = AnchorEntity(anchor: anchor) ... } The compiler error message is not even consistent. Sometimes I get a single error message: Cannot convert value of type 'ARAnchor' to expected argument type 'AnchoringComponent.Target' Other times I get an error with two possible issues: No exact matches in call to initializer Candidate '() -> AnchorEntity' requires 0 arguments, but 1 was provided (RealityFoundation.AnchorEntity) Candidate expects value of type 'AnchoringComponent.Target' for parameter #1 (got '(anchor: ARAnchor)') I'm trying to track down why this sometimes causes an error and sometimes it does not. Any pointers?
1
0
1.7k
Nov ’22
State of the Union video on iOS or Apple TV
When I try to watch the WWDC22 "Platforms State of the Union" video on my Apple TV, iPhone, or iPad, using the Developer app, the video only shows a single frame every few seconds and there is no audio. The video plays fine on the Developer app on my Mac. Has anyone else had this problem? Is there a work around? (I've tried deleting the Developer app on my Apple TV and reinstalling it, but no joy).
1
0
840
Jan ’23
Multiple BodyTrackedEntities?
Can ARKit/RealityKit track multiple bodies for animation simultaneously? Reviewing Apple's CapturingBodyMotionIn3D sample code (for WWDC2019 session), there is no explicit linkage between the ARBodyAnchor and the loaded BodyTrackedEntity (e.g., the AnchorEntity used for the BodyTrackedEntity is not associated with the ARBodyAnchor). There seems to be some hidden linkage between the ARKit ARBodyAnchor and the RealityKit BodyTrackedEntity. Likewise, the ARFrame has a property for only a single ARBody2D (detectedBody). My interpretation is that only a single person can be tracked at a time. Is this correct?
1
0
1.2k
Jan ’23
AnchorEntity a child of an Entity?
Reviewing Apple's AnchorEntity documentation, I see that an AnchorEntity can be a child of an Entity in the RealityKit hierarchy. Has it always been this way? In my memory, an AnchorEntity was always just the base element in a Scene. If this was a change by Apple at some point, has Apple given examples where making an AnchorEntity a child of an Entity lets you do cool things you couldn't do before?
1
0
891
Feb ’23
Logging not redacting strings in Xcode
This is probably a minor point because it wouldn't affect distributed binaries, but I thought I'd mention it in case the behavior is unexpected. After watching WWDC 20202 Explore logging in Swift, I tried some simple examples in a Mac command-line app. I was surprised to see the strings were all printed just fine. There was no redaction. At least when running the program from Xcode. (Even using the old os_log() approach showed the strings without needing to add %{public}@.) However, if I run the program from a Terminal shell, the string arguments are properly redacted. I actually like this behavior (showing more while running in Xcode), but I thought I'd just raise the issue. Sample code and screenshot from Console are shown below. import Foundation import os let logger = Logger(subsystem: "com.example.logging_test", category: "hello") let greeting = "Hello" let personName = "World" logger.log("\(greeting), \(personName)") logger.log("\(greeting, privacy: .private), \(personName)") logger.log("\(greeting, privacy: .public), \(personName)") os_log("%@, %@", greeting, personName)
1
0
1.4k
Mar ’23
PerspectiveCamera in portrait and landscape modes
I have an ARView in nonAR cameraMode and a PerspectiveCamera. When I rotate my iPhone from portrait to landscape mode, the size of the content shrinks. For example, the attached image shows the same scenes with the phone in portrait and landscape modes. The blue cube is noticeable smaller in landscape. The size of the cube relative to the vertical space (i.e., the height of the view) in each situation is consistent. Is there a way to keep the scene (e.g., the cube) the same size whether I am in portrait or landscape mode?
1
0
828
Aug ’23
Portals and ImmersiveSpace?
I've added a simple visionOS Portal to an app's initial WindowGroup (a window with an attached portal is all that is displayed), but I've had troubles adding a portal to an ImmersiveSpace. For example, using the boilerplate code that Xcode creates for a mixed spatial experience, I'd like to turn on & off the ImmersiveSpace which has a portal in it. So far, the portal isn't showing up. Is it possible to add a portal to an ImmersiveSpace? Are there any restrictions on where portals can be added?
1
0
784
Feb ’24
SpatialTapGesture and collision surface's normal?
I see example code converting the results of a SpatialTap to a SIMD3 location. For example, from WWDC session Meet ARKit for spatial computing: let location3D = value.convert(value.location3D, from: .global, to: .scene) What I really want is a simd_float4x4 that includes orientation of the surface that the tap gesture/cast collided with? My goal is to place an object with its Y-axis along the normal of the surface that was tapped. For example, in the referenced WWDC session, they create a CollisionComponent from the MeshAnchor data. If that mesh data is covering a curved couch cushion, I would like the normal from that curved cushion (i.e., the closest triangle approximating it). Is this possible? My planned fallback is to only use planes for collision surfaces for tap gestures, extract the tap gesture value's entity (which I am hoping is the plane), and grab its transform for the orientation information. I am hoping Apple has a simple function call that is more general than my fallback approach.
1
0
799
Mar ’24
Xbox controller and visionOS 2
I am having problems getting button input from an Xbox game controller. I have the visionOS 2 beta on my Apple Vision Pro, and I am trying to use an Xbox game controller with a RealityView following the instructions from the WWDC session Explore game input in visionOS. The notification about a game controller is picking up the game controller, finds GCInputButtonA, and I am setting closures for touchedChangedHandler, pressedChangedHandler, and valueChangedHandler that just print an os_log statement. buttonA.valueChangedHandler = { button, value, pressed in os_log("Got valueChangedHandler") } At the end of RealityView, I have the modifier RealityView { content in // stuff } .handlesGameControllerEvents(matching: .gamepad) But I am never seeing the log message appear in the console when I press the 'A' button (or any other button). Any ideas what I might be doing wrong? The Xbox controller is pretty old. Settings is reporting it as version 9.0.3
1
1
1.2k
Jun ’24
Getting the Wi-Fi's SSID on macOS
I want to extend an existing macOS app distributed through the Mac App Store with the capability to track the Wi-Fi's noise and signal strength along with the SSID it is connected to over time. Using CWWiFiClient.shared().interface(), I can get noiseMeasurement() and rssiValue() fine, but ssid() always returns nil. I am assuming this is a privacy issue (?). Are there specific entitlements I can request or ways to prompt the user to grant the app privilege to access the SSID values?
1
0
1.2k
Jul ’24
App Environment SkyDome's UV values
I started a visionOS app using Apple's new "App Environment" template, and when I looked at the UV mapping for the half SkyDome, the bottom edge had a UV 'Y' value of 0.318. Naively, I had assumed the bottom edge of a half dome would have a UV 'Y' value of 0.5 (half way up the texture map). Is this the standard UV mapping for half a SkyDome? It has caused some issues when I've applied some HDRIs.
1
0
714
Sep ’24
StoreKit 2 demo buy buttons flips state
I've been playing with Apple's StoreKit 2 demo code (buying the cars, subscriptions, ...), and sometimes when I purchase a car, one or more of the other buttons visually flip state (e.g., purchased checkmark changes back to the price). Leaving the StoreView and returning to it shows the correct state for each of the buttons. I am using the StoreKit Configuration Products.storekit (for the scheme), so testing in Xcode. I get this in both the simulator and on my actual phone. The issue is random. The vast majority of the time everything works perfectly. Is anyone else seeing this issue? Does anyone know how to address it? Dev environment: Xcode 13.0 beta 5 (13A5212g) macOS 12.0 Beta (21A5534d) Mac mini (M1, 2020)
Replies
1
Boosts
0
Views
802
Activity
Oct ’21
Guidance on USDZ model sizes
I'm looking for documentation/guidance on USDZ and scene model sizes. My focus is on RealityKit-based apps. I found the 2018 WWDC presentation Integrating Apps and Content with AR Quick Look which mentions a rule of thumb for a USDZ model of: 100K polygons One set of 2048x2048 textures 10 seconds of animations Are these number still recommended in 2021? Are these numbers just for Quicklook, or do they apply to RealityKit-based apps too? If a RealityKit scene loads several USDZ models, should the cumulative number of polygons across all models be 100K, or is the 100K number on a per-model basis? The talk mentioned AR Quicklook will dynamically downsample textures for devices with less memory. Does RealityKit do this as well? If so, can I error on providing a larger texture (e.g., 4096 x 4096) and trust RealityKit to downsample as appropriate for me? (I am hoping there is some documentation covering questions like this)
Replies
1
Boosts
0
Views
2k
Activity
Nov ’21
Are RealityKit lights expensive?
I am finding some unexpected behavior with lights I've been adding to a RealityKit scene. For example, I created 14 PointLights, but only 8 appeared to be used to illuminate the scene. In another example, I created 7 PointLights and 7 SpotLights, and the frame rate dropped quite a bit. Are lights computationally expensive, causing some adaptive behavior by RealityKit? Should I be judicious in my use of lights for a scene? (Note: I set arView.environment.lighting.resource to a Skybox with a black image; my goal was to completely control the lighting. I don't know if that added to the computational load)
Replies
1
Boosts
1
Views
1.2k
Activity
Dec ’21
Setting lensPosition to focus at infinity
I am creating a fixed-focus camera app with the focus distance at infinity (or at least 30+ feet away). When I set lensPosition to 1.0, the images were blurry. Some tests letting autofocus do the job showed a lensPosition of about 0.808 for my wide and telephoto lenses and 0.84 for the ultra wide lens did the trick. (iPhone 13 Max) Will the lensPosition to focus at infinity vary between devices and lenses on that device? Is there a way to determine the appropriate lensPosition at run time?
Replies
1
Boosts
0
Views
894
Activity
May ’22
AnchorEntity from ARAnchor bug?
I am running into a strange bug where the exact same code compiles fine in one project but generates a compiler error in another project. In particular, I am trying to create an AnchorEnity from an ARAnchor. func addModelTo(anchor: ARAnchor) { let entityAnchor = AnchorEntity(anchor: anchor) ... } The compiler error message is not even consistent. Sometimes I get a single error message: Cannot convert value of type 'ARAnchor' to expected argument type 'AnchoringComponent.Target' Other times I get an error with two possible issues: No exact matches in call to initializer Candidate '() -> AnchorEntity' requires 0 arguments, but 1 was provided (RealityFoundation.AnchorEntity) Candidate expects value of type 'AnchoringComponent.Target' for parameter #1 (got '(anchor: ARAnchor)') I'm trying to track down why this sometimes causes an error and sometimes it does not. Any pointers?
Replies
1
Boosts
0
Views
1.7k
Activity
Nov ’22
State of the Union video on iOS or Apple TV
When I try to watch the WWDC22 "Platforms State of the Union" video on my Apple TV, iPhone, or iPad, using the Developer app, the video only shows a single frame every few seconds and there is no audio. The video plays fine on the Developer app on my Mac. Has anyone else had this problem? Is there a work around? (I've tried deleting the Developer app on my Apple TV and reinstalling it, but no joy).
Replies
1
Boosts
0
Views
840
Activity
Jan ’23
Multiple BodyTrackedEntities?
Can ARKit/RealityKit track multiple bodies for animation simultaneously? Reviewing Apple's CapturingBodyMotionIn3D sample code (for WWDC2019 session), there is no explicit linkage between the ARBodyAnchor and the loaded BodyTrackedEntity (e.g., the AnchorEntity used for the BodyTrackedEntity is not associated with the ARBodyAnchor). There seems to be some hidden linkage between the ARKit ARBodyAnchor and the RealityKit BodyTrackedEntity. Likewise, the ARFrame has a property for only a single ARBody2D (detectedBody). My interpretation is that only a single person can be tracked at a time. Is this correct?
Replies
1
Boosts
0
Views
1.2k
Activity
Jan ’23
AnchorEntity a child of an Entity?
Reviewing Apple's AnchorEntity documentation, I see that an AnchorEntity can be a child of an Entity in the RealityKit hierarchy. Has it always been this way? In my memory, an AnchorEntity was always just the base element in a Scene. If this was a change by Apple at some point, has Apple given examples where making an AnchorEntity a child of an Entity lets you do cool things you couldn't do before?
Replies
1
Boosts
0
Views
891
Activity
Feb ’23
Logging not redacting strings in Xcode
This is probably a minor point because it wouldn't affect distributed binaries, but I thought I'd mention it in case the behavior is unexpected. After watching WWDC 20202 Explore logging in Swift, I tried some simple examples in a Mac command-line app. I was surprised to see the strings were all printed just fine. There was no redaction. At least when running the program from Xcode. (Even using the old os_log() approach showed the strings without needing to add %{public}@.) However, if I run the program from a Terminal shell, the string arguments are properly redacted. I actually like this behavior (showing more while running in Xcode), but I thought I'd just raise the issue. Sample code and screenshot from Console are shown below. import Foundation import os let logger = Logger(subsystem: "com.example.logging_test", category: "hello") let greeting = "Hello" let personName = "World" logger.log("\(greeting), \(personName)") logger.log("\(greeting, privacy: .private), \(personName)") logger.log("\(greeting, privacy: .public), \(personName)") os_log("%@, %@", greeting, personName)
Replies
1
Boosts
0
Views
1.4k
Activity
Mar ’23
PerspectiveCamera in portrait and landscape modes
I have an ARView in nonAR cameraMode and a PerspectiveCamera. When I rotate my iPhone from portrait to landscape mode, the size of the content shrinks. For example, the attached image shows the same scenes with the phone in portrait and landscape modes. The blue cube is noticeable smaller in landscape. The size of the cube relative to the vertical space (i.e., the height of the view) in each situation is consistent. Is there a way to keep the scene (e.g., the cube) the same size whether I am in portrait or landscape mode?
Replies
1
Boosts
0
Views
828
Activity
Aug ’23
Portals and ImmersiveSpace?
I've added a simple visionOS Portal to an app's initial WindowGroup (a window with an attached portal is all that is displayed), but I've had troubles adding a portal to an ImmersiveSpace. For example, using the boilerplate code that Xcode creates for a mixed spatial experience, I'd like to turn on & off the ImmersiveSpace which has a portal in it. So far, the portal isn't showing up. Is it possible to add a portal to an ImmersiveSpace? Are there any restrictions on where portals can be added?
Replies
1
Boosts
0
Views
784
Activity
Feb ’24
SpatialTapGesture and collision surface's normal?
I see example code converting the results of a SpatialTap to a SIMD3 location. For example, from WWDC session Meet ARKit for spatial computing: let location3D = value.convert(value.location3D, from: .global, to: .scene) What I really want is a simd_float4x4 that includes orientation of the surface that the tap gesture/cast collided with? My goal is to place an object with its Y-axis along the normal of the surface that was tapped. For example, in the referenced WWDC session, they create a CollisionComponent from the MeshAnchor data. If that mesh data is covering a curved couch cushion, I would like the normal from that curved cushion (i.e., the closest triangle approximating it). Is this possible? My planned fallback is to only use planes for collision surfaces for tap gestures, extract the tap gesture value's entity (which I am hoping is the plane), and grab its transform for the orientation information. I am hoping Apple has a simple function call that is more general than my fallback approach.
Replies
1
Boosts
0
Views
799
Activity
Mar ’24
Xbox controller and visionOS 2
I am having problems getting button input from an Xbox game controller. I have the visionOS 2 beta on my Apple Vision Pro, and I am trying to use an Xbox game controller with a RealityView following the instructions from the WWDC session Explore game input in visionOS. The notification about a game controller is picking up the game controller, finds GCInputButtonA, and I am setting closures for touchedChangedHandler, pressedChangedHandler, and valueChangedHandler that just print an os_log statement. buttonA.valueChangedHandler = { button, value, pressed in os_log("Got valueChangedHandler") } At the end of RealityView, I have the modifier RealityView { content in // stuff } .handlesGameControllerEvents(matching: .gamepad) But I am never seeing the log message appear in the console when I press the 'A' button (or any other button). Any ideas what I might be doing wrong? The Xbox controller is pretty old. Settings is reporting it as version 9.0.3
Replies
1
Boosts
1
Views
1.2k
Activity
Jun ’24
Getting the Wi-Fi's SSID on macOS
I want to extend an existing macOS app distributed through the Mac App Store with the capability to track the Wi-Fi's noise and signal strength along with the SSID it is connected to over time. Using CWWiFiClient.shared().interface(), I can get noiseMeasurement() and rssiValue() fine, but ssid() always returns nil. I am assuming this is a privacy issue (?). Are there specific entitlements I can request or ways to prompt the user to grant the app privilege to access the SSID values?
Replies
1
Boosts
0
Views
1.2k
Activity
Jul ’24
App Environment SkyDome's UV values
I started a visionOS app using Apple's new "App Environment" template, and when I looked at the UV mapping for the half SkyDome, the bottom edge had a UV 'Y' value of 0.318. Naively, I had assumed the bottom edge of a half dome would have a UV 'Y' value of 0.5 (half way up the texture map). Is this the standard UV mapping for half a SkyDome? It has caused some issues when I've applied some HDRIs.
Replies
1
Boosts
0
Views
714
Activity
Sep ’24