ios – Aircraft entity’s grounding shadow flicking in RealityKit

[ad_1]

I created a airplane with unlit materials with png texture, and I would like use it as an indicator to point out customers the place to place fashions within the scene.
But when the grounding shadow is enabled, the airplane is flickering with shadow and appears actually bizarre.

If the grounding shadow is disabled it really works high quality. However I do need different fashions have grounding shadow. So I’m wondering if I can disable this particular airplane’s grounding shadow, or if there’s a option to resolve the flickering?

Here is my code

let planeMesh = MeshResource.generatePlane(width: 0.8, depth: 0.8)
let planeAnchor = AnchorEntity(airplane: .horizontal)
var materials = UnlitMaterial(coloration: .white)
materials.coloration.texture = attempt! .init(.load(named:"indicator"))
indicatorEntity = ModelEntity(mesh: planeMesh, supplies: [material])
planeAnchor.addChild(indicatorEntity)
arView.scene.addAnchor(planeAnchor)
    func session(_ session: ARSession, didUpdate body: ARFrame) {
        guard let outcome = self.arView.raycast(from: arView.heart, permitting: .estimatedPlane, alignment: .horizontal).first else {
            return
        }
        indicatorEntity.setTransformMatrix(outcome.worldTransform, relativeTo: nil)
    }

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *