Hi there!
I'm trying to add a png image as texture in a material, but the transparency is not carried over. Areas that should have transparency have a black color instead. I've tried the different materials UnlitMaterial and SimpleMaterial. How can I fix this?
Thanks
var profileMaterial = UnlitMaterial()
profileMaterial.baseColor = try! .texture(.load(named: "profilePicture.png"))
let profileMesh = MeshResource.generatePlane(width: 0.2, height: 0.2)
let profilePlane = ModelEntity.init(mesh: profileMesh, materials: [profileMaterial])
I've been able to overcome this issue for the time being by setting the tint color of the material to:
let resource = try? TextureResource.load(named: "halo")
var material = UnlitMaterial()
material.baseColor = MaterialColorParameter.texture(resource!)
material.tintColor = UIColor.white.withAlphaComponent(0.99)