sheldor
sheldor

Reputation: 159

Frame by Frame Animation with many particles?

What is the best way to draw frame by frame animations when there are many particles on the screen? Currently using a uigraphicsimagerenderer with a cadisplaylink. Every refresh the image is redrawn but on an older device there are performance issues because I want to draw a lot of small points which are all calculated every frame (one new point is added and the oldest is removed, so the points in the middle would stay at position, perhaps a thing to optimize something?). Any suggestions to improve this to get constant framerates although there are a lot of „particles“

Upvotes: 2

Views: 116

Answers (2)

Duncan C
Duncan C

Reputation: 131398

iOS device hardware is not well suited to frame-by-frame rendering. At the hardware level it supports tiled rendering, backed by CALayer objects. You are much better off taking advantage of the way the rendering engine works. There is a rich particle generation system, for example. You set up particle generators and the OS takes care of rendering them.

Upvotes: 0

Vym
Vym

Reputation: 543

SpriteKit is great for implementing high-performance particle systems. It's highly tweakable and has a powerful WYSIWYG particle editor built into Xcode.

Custom solutions using Core Animation typically lack these advantages unless you really know exactly what you're doing.

Upvotes: 3

Related Questions