Post

Replies

Boosts

Views

Activity

Loading a RealityKit image texture from a URL
I'm trying to load an image from the internet as an image texture for a material in RealityKit & running into trouble. I'm using code similar to the block below: var material = SimpleMaterial(color: .white, roughness: 0.9, isMetallic: true) let url = URL("https://example.com/image.png") material.baseColor = try! .texture(.load(contentsOf: url)) Unfortunately this leads to an error, with the texture failing to load the image from the URL. Is it possible to load an image from the web as the texture for a RealityKit material? Is there a possible workaround if not directly?
3
0
5.4k
Mar ’22
Loading a RealityKit image texture from a URL
I'm trying to load an image from the internet as an image texture for a material in RealityKit & running into trouble. I'm using code similar to the block below: var material = SimpleMaterial(color: .white, roughness: 0.9, isMetallic: true) let url = URL("https://example.com/image.png") material.baseColor = try! .texture(.load(contentsOf: url)) Unfortunately this leads to an error, with the texture failing to load the image from the URL. Is it possible to load an image from the web as the texture for a RealityKit material? Is there a possible workaround if not directly?
Replies
3
Boosts
0
Views
5.4k
Activity
Mar ’22