Is there a technique to apply a png with an alpha channel, so that the opaque parts of the image are "stamped" onto the entity's surface like a decal?
The code shown applies an image to all 6 sides of a box. It works, but the box geometry itself becomes transparent wherever the texture is transparent. I would like the box to remain opaque with the base color showing through.
let block = MeshResource.generateBox(width: 0.1, height: 0.1, depth: 0.1, cornerRadius: 0.01, splitFaces: false)
var material = PhysicallyBasedMaterial()
material.blending = .transparent(opacity: 1.0)
do {
let texture = try TextureResource.load(named: "texture_9")
material.baseColor = .init(tint: .white, texture: .init(texture))
let entity = ModelEntity(mesh: block, materials: [material])
} catch {
print("TextureResource.load(...) failed")
}