FPS drop while updating ModelEntity position

Hi there.

I have a performance issue when updating ModelEntity's position.

There are two models with the same parent:

arView.scene.add(anchorEntity)

anchorEntity.addChild(firstModel)
anchorEntity.addChild(secondModel)

The firstModel is very large model.

I am taking position of second model and applying it to the first:

func session(_ session: ARSession, didUpdate frame: ARFrame) {
    // ...

    // Here the FPS drops
    firstModel.position = secondModel.position

    // ...
}

In other 3D Engines changing the transform matrix do not affects the performance. You can change it like hundred times in a single frame. It's only renders the last value on next frame.

It means that the changing position itself should not cause FPS drop. If it's low, it will be always low, because there is always a value in transform matrix, and the renderer always renders what stored there. If you change the value, the next frame will basically be rendered with the new value, nothing heavy will not be happen.

But in my case the FPS drops only if the model's position got changed. If it's not, the FPS is 60. So the changing transform matrix caused FPS drop.

Can anyone describe why the RealityKit's renderer works in that way?

FPS drop while updating ModelEntity position
 
 
Q