I found out the cause of the issue I posted in the comment above:
You cannot update a model's mesh like this:
self.model?.mesh = MeshResource.generatePlane(
width: planeAnchor.extent.x,
depth: planeAnchor.extent.z
)
You must re-create the entire model anytime you want to update the size of it!
var material = SimpleMaterial(color: .blue, isMetallic: true)
material.tintColor = .init(white: 1, alpha: 0.5)
self.model = ModelComponent(
mesh: .generatePlane(
width: planeAnchor.extent.x,
depth: planeAnchor.extent.z
),
materials: [material]
)
'
Will be opening a new ticket to show an easy reproduction later today. For anyone else with the issue, updating the mesh size breaks transparency
Topic:
Graphics & Games
SubTopic:
RealityKit
Tags: