I have generated a box in RealityKit with splitFaces
property set to true
to allow different materials on each cube side.
Applying different SimpleMaterials (e.g. with different colors) works fine on Vision Pro simulator. But combining VideoMaterial
and SimpleMaterial
does not work. BTW: a 6x video cube can be rendered successfully so the problem seems to be mixing material structures.
Here's my relevant code snippet:
let mesh = MeshResource.generateBox(width: 0.3, height: 0.3, depth: 0.3, splitFaces: true)
let mat1 = VideoMaterial(avPlayer: player)
let mat2 = SimpleMaterial(color: .blue, isMetallic: true)
let mat3 = SimpleMaterial(color: .red, isMetallic: true)
let cube = ModelEntity(mesh: mesh, materials: [mat1, mat2, mat3, mat1, mat2, mat3])
In detail, the video textures are shown whereas the simple surfaces are invisible.
Is this a problem of Vision Pro simulator? Or is it not possible to combine different material structures on a box? Any help is welcome!