PDA

View Full Version : CALayers powerful enough?




MatthewF
Nov 5, 2010, 07:26 AM
Would CALayers be powerful enough to handle a tile-based game with around 800 tiles moving at once?
(Would it also work well with one CALayer per tile?)

Thanks,
-Matt
P.S. Would OpenGl be better for this task then CALayers? I really like using CAAnimation instead of making timers and manually doing it by hand. Is there a way to have incredible performance and CAAnimation?



jared_kipe
Nov 5, 2010, 10:20 AM
Of course openGL would be better.

The only good way to tell would be to try it out.

MatthewF
Nov 5, 2010, 11:04 AM
An OpenGl tile base engine produces good results. I'm working on the CALayer tile engine at the moment.

If CALayer results are dissatisfying is there a way for me to use OpenGl with CAAnimation?
I think I saw something about a CAEAGLLayer...


-Matt

kainjow
Nov 5, 2010, 12:57 PM
If CALayer results are dissatisfying is there a way for me to use OpenGl with CAAnimation?
I think I saw something about a CAEAGLLayer...

That is for iOS. For OS X you can use CAOpenGLLayer.

HiRez
Nov 5, 2010, 01:53 PM
Is this a Mac game or an iPhone/iPad game? 800 layers on the desktop seems entirely reasonable (in fact I've seen CoreAnimation layer demos with more than that moving simultaneously). On a mobile device it's questionable, especially if most of your layers are not very small. If I had to guess, I'd say 800 layers on an iPad is not going to work very well currently. Also have to consider the limited RAM. Big difference between a 2+ GHz multicore desktop CPU with dedicated GPU and a mobile CPU/GPU with limited resources.

MatthewF
Nov 5, 2010, 04:58 PM
I have my CALayer tile engine working and the results are great. Though the only downside is that it appears that a white line can appear between the tiles as the world moves... is there any way to fix that?

Figured it out. Just had to make the frame extend 1 pixel out on each side.


Thanks,
-Matt
P.S. Would CAOpenGLLayer have better performance than a CALayer when just displaying an image?