4

I am designing a particle system using Apple's CAEmitterLayer and CAEmitterCell and everything is going GREAT on the iPhone5 and simulator. But as soon as I run it on an iPhone4S the particle system kills the FPS. Now I tried decreasing the amount of particles on screen up to the point where only one particle is created per second and the FPS drops the same as when 500 particles are being created per second. The iPhone4S is running iOS 6.1.3 and the iPhone5 is running iOS 6.1.4.

Is there a reason why CAEmitterLayer is slowing down the game THIS much? Even though only a single particle is being created each second?

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
Parad0x13
  • 2,007
  • 3
  • 23
  • 38
  • Not sure if this helps, but have you tried varying other parameters of `CAEmitter___`? By the way500 particles is *too many*. – Khanh Nguyen Jun 27 '13 at 03:34
  • I used 500 as a speed test. I'm not sure what parameters of the CAEmitter would need changing to answer the question though, the same parameters work fine on iPhone5 but not at all fine on iPhone4. I know there is a spec difference but I didn't think it was THAT much different – Parad0x13 Jun 27 '13 at 07:07

2 Answers2

1

This helped me with getting framerates up:

emitterLayer.shouldRasterize=YES;
user1459524
  • 3,613
  • 4
  • 19
  • 28
1

cellLayer.lifetime = 10;

Reducing the lifetime of CAEmitterCell may help you.

Here are some example for CAEmitterLayer https://github.com/JJMM/CUSSender.

random
  • 8,568
  • 12
  • 50
  • 85
zhangyu313
  • 11
  • 2