リアリティキットを使用してテキストを表示しようとしていますが、コードがコンパイルされ、シーンが開始されますが、シーンにテキストが表示されません。
私は iOS 13.1.2 を実行している iPhone 7 を使用しています。同じコードを試してみましたが、ボックス メッシュ リソースを使用したところ、問題なく動作しました。
私のコントローラは次のようになります
func makeUIView(context: Context) -> ARView {
let arView = ARView(frame: .zero)
let anchor = AnchorEntity(plane: .horizontal)
let mesh = MeshResource.generateText("text")
let color = UIColor.systemBlue
let material = UnlitMaterial(color: color)
let entity = ModelEntity(mesh: mesh, materials: [material])
anchor.addChild(entity)
// Add the box anchor to the scene
arView.scene.anchors.append(anchor)
return arView
}
前に言ったように、実行時にコンソールに次のエラーが表示されます。
2019-10-02 09:07:33.707275+0200 tesss[646:78901] Compiler failed to build request
2019-10-02 09:07:33.707476+0200 tesss[646:78901] [Graphics] makeRenderPipelineState failed [output of type ushort is not compatible with a MTLPixelFormatR16Float color attachement.].
2019-10-02 09:07:33.707507+0200 tesss[646:78901] [Graphics] makeRenderPipelineState failed.