SpriteKit - minimize quadcount

折月煮酒 提交于 2019-12-08 04:34:08

问题


I've been trying to teach myself SpriteKit and jumped into Raywenderlich's tutorials which said that QuadCount should be minimized for a better performance. I turned on showQuadCount, showDrawCount, showNodeCount for debugging. However, I saw quadcount is always equals to node count. Anyone can help me explain in a simple way what quadcount really is and give me an example on that quadcount is different from nodecount. (I did search google but I can not understand, so please do not give me a link without explaination). Thanks so much.


回答1:


Every node that draws something draws a quad (two triangles).

So only SKNode nodes which don't draw anything will not increase the quad count.

Also, quad count nearly isn't everything. It's more important to support Sprite Kit's internal batching by using texture atlases, and avoiding child nodes that use different texture atlas than their parent, otherwise this would interrupt batching.



来源:https://stackoverflow.com/questions/27800614/spritekit-minimize-quadcount

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!