Is it possible to use ParticleSystems in SpriteSheets for a performance benefit? I'm guessing not since ParticleSystems inherit from CCnodes and not from CCSprites.
André
A fast, easy to use, free, and community supported 2D game engine
Is it possible to use ParticleSystems in SpriteSheets for a performance benefit? I'm guessing not since ParticleSystems inherit from CCnodes and not from CCSprites.
André
Dont think you can.
You can't add particles to sprite sheet, but particles utilize its own "batch draw" for displaying on the screen. So when you add particles it's only one more OpenGL call for your app, so no big difference
Thanks. Do you know if each ParticleSystem instance has its own draw call for all its particles, or would multiple ParticleSystems share a call?
I'm not getting acceptable performance with more than 2-3 emitters (I'm shooting for 10-20), but perhaps that's just the nature of these beasts.
André
Each system will do a draw of its particles. I too would like to have a multi-emitter solution to particles. But cocos2d doesn't have this yet.
I'm trying to do an effect that requires a few emitters but i cant get the performance on older devices. Something like CJ suggested would be very helpful.
What if each emitter uses the same texture? There must be a way to reference that single texture instead of embedding it in each particle plist, right?
The texture from a emitter is loaded into the texture cache, when initializing the other emitters they get a reference to the texture from the cache. So if you draw all the emitters after each other, there wouldn't be a texture switch in between, which is a small performance benefit.
If you make sure the texture is loaded before initializing the emitter, then the textureImageData in the plist can be removed.
I'm not sure how much work it would be to update the code, but this thread talks about reusing particle systems for added performance
http://www.cocos2d-iphone.org/forum/topic/177
-Mark
I found that Particle Designer was naming the texture the name I gave the plist. Even though it was the same image, it was creating a new texture for each system.
<key>textureFileName</key>
<string>texture.png</string>
Your texture will be properly cached!
You must log in to post.