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: