Post

Replies

Boosts

Views

Activity

Reply to Image Input for ShaderGraphMaterial
Here is what I did to send an image to ShaderGraphMaterial. let img = getSomeUIImage() let mat = getShaderGraphMaterial() if let cgImg = img.cgImage { let texture = try TextureResource.generate(from: cgImg, options: TextureResource.CreateOptions.init(semantic: nil)) try mat.setParameter(name: "cover", value: .textureResource(texture)) }
Topic: Graphics & Games SubTopic: RealityKit Tags:
Aug ’23
Reply to Render material on the inside of a sphere.
I create a sphere that I use for sky and display an image on the inside of it by changing the scale property on the Entity. Here is how I create a very large sphere and have the material rendered on the inside of it. let entity = Entity() entity.components.set(ModelComponent( mesh: .generateSphere(radius: 100000), materials: [material] )) // Ensure the texture image points inward at the viewer. entity.scale *= .init(x: -1, y: 1, z: 1)
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’23
Reply to 'PointLight' is unavailable in xrOS
I see that the documentation has been updated to show that PointLight, DirectionalLight, and SpotLight are not available on visionOS. Does anyone know how to add a light source to a RealityKit scene on visionOS? I am working on a fully immersive experience and I need to add light from the sun to my scene, but I can't figure out how to do it.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Jul ’23
Reply to Not able to get Apple Watch Ultra Action Button Support working
I found exactly what I have to do with my app to get the action button to work. I have to use Xcode 14.0.1 I had to remove CryptoSwift as a package dependency and add it as an xcframework instead. What is odd is that I am linking against the exact same version of CryptoSwift, I just had to change how I brought it into my project. I found that the reason I did not have constant results was that I needed to delete the DerivedData every time I switch versions of Xcode. I could not get the action button to work with my app using Xcode 14.1 or Xcode 14.2. Most likely there is something else, like removing the CryptoSwift packager dependency that I need to do to get it to work. I tried removing the other swift package dependencies that I have and that did not make any difference.
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’23
Reply to Not able to get Apple Watch Ultra Action Button Support working
I have found a little more information on this, but I have not yet been able to pinpoint it. I thought I would share where I am at in case it helps someone else find this issue. I found that if I build the app with Xcode 14.0 and remove CryptoSwift as a package dependency most of the time I can get it to work. I say most of the time because sometimes when I do a clean build on a new simulator it still does not work. But about 80% of the time it is working for me when I do this. I then tried Xcode 14.1 with CryptoSwift removed from my project and I got it to work once, but I was never able to get it to work again when I would do a fresh build. With each of these tests I was using a watchOS 9.0 simulator. I then tried building with Xcode 14.0 without CryptoSwift as a dependency and I was able to select my app for the action button on my Apple Watch Ultra running watchOS 9.3. This does seem to point to a bug in Xcode 14.2 with the build settings and dependences. I am going to keep experimenting to see if I can pinpoint exactly what the combination is that makes it work. I am able to get https://github.com/KhaosT/WatchActionButtonExample to work just fine with Xcode 14.2. If anyone else is seeing this and has information on this issue, I would greatly appreciate any insights you might have.
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’23
Reply to Image Input for ShaderGraphMaterial
Here is what I did to send an image to ShaderGraphMaterial. let img = getSomeUIImage() let mat = getShaderGraphMaterial() if let cgImg = img.cgImage { let texture = try TextureResource.generate(from: cgImg, options: TextureResource.CreateOptions.init(semantic: nil)) try mat.setParameter(name: "cover", value: .textureResource(texture)) }
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to How is Safari's sidebar animation implemented in visionOS?
I have the same question, but so far I have not found anyway to do this with public APIs. https://developer.apple.com/forums/thread/732953
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Render material on the inside of a sphere.
I create a sphere that I use for sky and display an image on the inside of it by changing the scale property on the Entity. Here is how I create a very large sphere and have the material rendered on the inside of it. let entity = Entity() entity.components.set(ModelComponent( mesh: .generateSphere(radius: 100000), materials: [material] )) // Ensure the texture image points inward at the viewer. entity.scale *= .init(x: -1, y: 1, z: 1)
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to 'PointLight' is unavailable in xrOS
I see that the documentation has been updated to show that PointLight, DirectionalLight, and SpotLight are not available on visionOS. Does anyone know how to add a light source to a RealityKit scene on visionOS? I am working on a fully immersive experience and I need to add light from the sun to my scene, but I can't figure out how to do it.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Pass interpolated values to SceneKit Fragment Shader
I figured out a way to do this, though it does seem like more of a hack than a real solution. I encoded my values in the red channel of a color, I then created an image with those colors, and then I assigned texture coordinates for each vertex. That allowed me to get the correct interpolated value out in my fragment shader.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Not able to get Apple Watch Ultra Action Button Support working
I found exactly what I have to do with my app to get the action button to work. I have to use Xcode 14.0.1 I had to remove CryptoSwift as a package dependency and add it as an xcframework instead. What is odd is that I am linking against the exact same version of CryptoSwift, I just had to change how I brought it into my project. I found that the reason I did not have constant results was that I needed to delete the DerivedData every time I switch versions of Xcode. I could not get the action button to work with my app using Xcode 14.1 or Xcode 14.2. Most likely there is something else, like removing the CryptoSwift packager dependency that I need to do to get it to work. I tried removing the other swift package dependencies that I have and that did not make any difference.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Not able to get Apple Watch Ultra Action Button Support working
I have found a little more information on this, but I have not yet been able to pinpoint it. I thought I would share where I am at in case it helps someone else find this issue. I found that if I build the app with Xcode 14.0 and remove CryptoSwift as a package dependency most of the time I can get it to work. I say most of the time because sometimes when I do a clean build on a new simulator it still does not work. But about 80% of the time it is working for me when I do this. I then tried Xcode 14.1 with CryptoSwift removed from my project and I got it to work once, but I was never able to get it to work again when I would do a fresh build. With each of these tests I was using a watchOS 9.0 simulator. I then tried building with Xcode 14.0 without CryptoSwift as a dependency and I was able to select my app for the action button on my Apple Watch Ultra running watchOS 9.3. This does seem to point to a bug in Xcode 14.2 with the build settings and dependences. I am going to keep experimenting to see if I can pinpoint exactly what the combination is that makes it work. I am able to get https://github.com/KhaosT/WatchActionButtonExample to work just fine with Xcode 14.2. If anyone else is seeing this and has information on this issue, I would greatly appreciate any insights you might have.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Not able to get Apple Watch Ultra Action Button Support working
Did you ever figure this out? I am seeing the same thing and I can't figure out what I am doing wrong.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Not able to get Apple Watch Ultra Action Button Support working
Did you ever figure this out? We were able to get our app to show up for the action button and then it just disappeared from the action button list a few weeks ago. We can't find anything that has changed and we are also able to get https://github.com/KhaosT/WatchActionButtonExample to work just fine.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Failed to attach to IBAgent-iOS
Any luck getting this fixed? I am seeing the same thing, only I am not using any of the betas.
Replies
Boosts
Views
Activity
Jul ’21