Reputation: 41
While placing .scn file using ARKit 2 when user taps on screen models with single layer are rendering on screen instantly but problem arrises when multilayer(2 to 3 layers) .scn file taking about 1 to 3 seconds to render, kind of stuck UI while rendering? And once the ARConfiguration session is reset then it works fine for all the models. I have checked these models on apple provided demo for handling interaction app and same happens their also. Can anyone help me out why multilayer objects are not rendering instantly for the first time?
Upvotes: 1
Views: 127
Reputation: 41
Following process worked for me to render 3D models without camera stuck or any lag while placing the object(few objects were up-to 27mb in size):
Step 1: load .scn file as soon as view is loaded and configure the session
Step 2: call
[self.sceneView prepareObjects:@[self.modelNode] withCompletionHandler:^(BOOL success) {
dispatch_async(dispatch_get_main_queue(), ^{
//// TODO: according to your use case
});
}];
step 3: add scene(.scn) to your scene view
Upvotes: 1