当涉及到高度动画的用户界面时,openGL ES比Core Animation和UIKit有更好的性能吗? [英] Does openGL ES have a better performance than Core Animation and UIKit when it comes to highly animated user interfaces?

查看:119
本文介绍了当涉及到高度动画的用户界面时,openGL ES比Core Animation和UIKit有更好的性能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有一个用户界面,令人难以置信的大量使用核心动画。我不知道是否值得花费另外2个月的时间学习OpenGL ES?这是否真的提高2D表面的绘图性能?我没有3D对象,但高度动画的2D东西。有时3D变形,很多旋转和缩放。

Currently I have an user interface that makes incredible heavy use of core animation. I wonder if it is worth to spent another 2 months for learning openGL ES? Does that really improve drawing performance for 2D surfaces? I have no 3D objects, but highly animated 2D stuff. Sometimes with 3D distortions, a lot of rotations and scaling.

特别是我做了一个游戏,有很多精灵使用CA。性能确定但不完美。

In particular I made a whole game with lots of sprites just using CA. Performance is ok but not perfect.

推荐答案

在理论上,OpenGL应该是设备上最快的API, 。 (有人请纠正我,如果我错了这一点。)在OpenGL中,你可以做一些聪明的技巧,这将有助于你的表现相当多 - 你可以绘制精灵批处理,你可以使用点精灵,你可以尝试压缩纹理,等等。

In theory OpenGL should be the fastest API on the device, simply because it’s closest to hardware. (Somebody please correct me if I am wrong on this.) In OpenGL you can do some clever tricks that will help your performance quite a bit – you can draw the sprites in batches, you can use point sprites, you can try compressing the textures, etc.

另一方面,你非常接近硬件,没有太多的抽象留下,至少当与核心动画比较。你必须处理非功率的两个纹理,投影,矩阵,你必须自己写动画代码等。有很多地方你可以出错,严重杀死性能,而不是使它更好。

On the other hand you get very close to the hardware and there is not much abstraction left, at least when comparing to Core Animation. You have to deal with non-power-of-two textures, projections, matrices, you have to write the animation code yourself, etc. There is a lot of places you can go wrong and seriously kill the performance instead of making it better.

我喜欢OpenGL的是它的跨平台。有很多关于OpenGL的资源,还有很多空间需要改进。如果你想写游戏,有时间学习OpenGL,做它。将OpenGL基础包装到OOP设计中并不困难,最终你会获得更多的性能改进空间。开始的好地方是 iPhone的Cocos 2D引擎

What I like about OpenGL is that it’s cross-platform. There are lots of resources about OpenGL, there is a lot of space for improvement. If you want to write games and have the time to learn OpenGL, do it. Wrapping the OpenGL basics into an OOP design is not that hard and eventually you’ll get more space for performance improvements. A good place to start is the Cocos 2D engine for iPhone.

(免责声明:我只知道一点关于OpenGL和Core Animation的内容,使用OpenGL的iPhone游戏。)

(Disclaimer: I know just a little bit about OpenGL and nothing much about Core Animation. I’ve written two 2D games for iPhone using OpenGL.)

这篇关于当涉及到高度动画的用户界面时,openGL ES比Core Animation和UIKit有更好的性能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆