How to accelerate bulk SKNode actions?

iOS SpriteKit API is easy to use. However, if I run massive actions (about 5000+) on a large number of SKSpriteNodes (about 2000+) at the same time, the fps drops very low. But GPU usage in this situation is much less than CPU usage. Is there a way to speed things up on a GPU? Or is there a way to implement images with move, scale, fade and rotate actions in MetalKit?

+3


source to share


1 answer


You can use shaders on nodes to change their appearance. This would be useful for moving, scaling, fading and rotating nodes. I usually suggest using SKActions for these as they are very basic functions that the CPU usually processes instead of the GPU, and in your case, I would recommend that you look into why you need to make changes to some of the 2000 nodes in one go.



Whenever you have many nodes, you can replace them with SKEmitterNode. It is much more difficult to use PhysicalBodies with separate emissions, but they are much more resource friendly than using individual 5000 nodes.

0


source







All Articles