ios – Aircraft entity’s grounding shadow flicking in RealityKit

[ad_1]

I created a aircraft with unlit materials with png texture, and I need 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 aircraft is flickering with shadow and appears actually bizarre.

If the grounding shadow is disabled it really works tremendous. However I do need different fashions have grounding shadow. So I ponder if I can disable this particular aircraft’s grounding shadow, or if there’s a solution to resolve the flickering?

Here is my code

let planeMesh = MeshResource.generatePlane(width: 0.8, depth: 0.8)
let planeAnchor = AnchorEntity(aircraft: .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 consequence = self.arView.raycast(from: arView.middle, permitting: .estimatedPlane, alignment: .horizontal).first else {
            return
        }
        indicatorEntity.setTransformMatrix(consequence.worldTransform, relativeTo: nil)
    }

[ad_2]

Leave a Reply