When I display a node from a COLLADA
file, the CPU usage goes up to 100%+.
Link to pic
I am not using the simulator, I am using my actual phone. The model consists of about 80k vertices.
Here is how I load the model:
// Add Character
func addModel(name:String)
{
// Load COLLADA Model
if let myScene = SCNScene(named: "Assets.scnassets/"+name+"/"+name+".dae")
{
// Recurse through all the child nodes in the model and add to modelNode
for node in myScene.rootNode.childNodes as [SCNNode]
{
modelNode.addChildNode(node)
}
// Add modelNode to scene
self.rootNode.addChildNode(modelNode)
}
else
{
print("Error loading model: "+name)
}
}
The model is 122MB and can be found here:
Link to zip
I have tried with different models, but CPU goes nuts on each one of them. They are all about 122MB (which sounds large) and about 80k vertices.
Update
Tried to lower the poly count in SceneKit. In blender i lowered vertices from 20k to 5k (see here). But when I load the model in SceneKit the poly count is still the same (68k). I also tried converting the model and the animations to .SCN instead. This resulted in much lower file size, however the same poly count and CPU usage.
Pictures of showStatistics
I think what I need to do is lower the poly count, not so much the file size (don't think that would harm though).
Update 2 Now I actually managed to lower the poly count to about 48k. Still lagging. If I remove the texture, the CPU is much lower.