Thursday, 31 January 2019

FPS drop when adding child to a scene ARKit/SceneKit

I'm working on an ARKit project for 4 months now. I noticed that when adding a child to my scene rootNode, there is a FPS drop. The device freezes for less than a second. I did a lot of research and trials, noticed that all Apple's code examples have this FPS drop too when placing an object. It does not matter if the node is added directly (scene.rootNode.addChild(child)) or if it's added in the renderer loop at different phases (didUpdateAtTime, didApplyAnimations etc...). I found that once an object has been added to a scene, the next added object will render immediately. I use a 3D model created in SceneKit editor, clone it to generate my different nodes before adding them as child. I do this loading work before placing the objects.

Instruments shows that the renderer loop is busy for the duration of the freeze.

The only solution that I found is to add my nodes to the scene behind a loading screen before starting the whole experience.

Is that a normal behavior in game programming to render nodes before using them ?

Thanks guys



from FPS drop when adding child to a scene ARKit/SceneKit

No comments:

Post a Comment