Post marked as solved
Post marked as solved with 3 replies, 1,478 views
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?