Post

Replies

Boosts

Views

Activity

Reply to PNG with transparency as plane texture
So is there any updated way to do this in iOS 15? baseColor and tintColor are deprecated so you can't set the baseColor to the image texture and the tint to a slightly transparent white anymore. I've gotten it to work to some extent with this code, but it's still not right. ... let colorTexture = MaterialParameters.Texture(imageTexture) var imageMaterial = UnlitMaterial() imageMaterial.color = .init(tint: tint.withAlphaComponent(0.9999), texture: colorTexture) It renders correctly with just the opaque parts of the image until you move and then it shows the transparent plane behind it, which would be fine if there wasn't any content behind it, but that's not very flexible. Here's what it looks like: Using a SimpleMaterial doesn't help and leaves the image darker than it should be. Placing the icons in front of the background plane by 0.02-0.1 reduces the frequency of the effect but it can still happen. Additionally, 0.1 is way too far forward for many applications. What's the best way to fix this iOS 15? Do I just need to wait for iOS 16? Thanks.
Apr ’22
Reply to Navigation: update multiple times per frame
I'm having the same problem. My app would just freeze on a black screen on launch and would do absolutely nothing until I commented out all the .navigationDestination() calls. I was able to hack around it by elevating the .navigationDestination() calls closer to the NavigationStack they're in. This obviously isn't ideal and doesn't allow for as easily passing data nested in a view, but it's working for me for now. Maybe it was just my misunderstanding of the API in the first place and the navigationDestinations aren't supposed to depend on any data in the view presenting them other than what's passed in explicitly in the call. Most of my calls were just passing in the data for the View plus a binding to the NavigationPath, so it wasn't a problem to elevate them. Hope this helps someone.
Dec ’22