OpenGL-ES 2.0 VS OpenGL-ES 1.1,哪个更快? [英] OpenGL-ES 2.0 VS OpenGL-ES 1.1, which is faster?

查看:169
本文介绍了OpenGL-ES 2.0 VS OpenGL-ES 1.1,哪个更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用OpenGL-ES 1.1编写了一个应用程序,但我想知道通过切换到2.0是否可以找到速度增益。有没有人用大多边形计数模型做过任何测试?我只想渲染具有不同颜色的三角形,没什么花哨的。但是,我想为我的比较测试渲染大约100万个三角形。

I've written an app using OpenGL-ES 1.1, but am wondering if there are speed gains to be found by switching to 2.0. Has anyone done any tests with large polygon count models? I only want to render triangles that have different colors, nothing fancy. However, I am wanting to render about 1 million triangles for my comparison test.

推荐答案

OpenGL ES 1.1和2.0提供了两种截然不同的三维图形处理方式,所以我不知道直接性能比较很有意义。如果您创建仅仅模拟OpenGL ES 1.1的固定功能管道的2.0着色器,您可能会看到使用两者的相同性能。这得到了 Apple关于PowerVR SGX的文档的支持,其中说:

OpenGL ES 1.1 and 2.0 provide two very different ways of doing 3-D graphics, so I don't know that direct performance comparisons make much sense. You're probably going to see identical performance using both if you create 2.0 shaders that just simulate OpenGL ES 1.1's fixed function pipeline. This is backed by Apple's documentation on the PowerVR SGX, which says:


PowerVR SGX的图形驱动程序还通过有效实施OpenGL ES 1.1
来实现使用着色器的固定功能管道。

The graphics driver for the PowerVR SGX also implements OpenGL ES 1.1 by efficiently implementing the fixed-function pipeline using shaders.

为了渲染基本的平面三角形,我建议使用OpenGL ES 1.1,因为你需要编写更少的代码。如果您能够使用1.1中的内置功能,则通常更容易定位该版本。您还可以通过不支持2.0的硬件(现在)少数iOS设备所有者来获得更大的市场。

For rendering basic, flat-colored triangles, I'd suggest going with OpenGL ES 1.1 simply because you'll need to write a lot less code. If you are able to get by with the built-in functionality in 1.1, it's usually easier to target that version. You also have a slightly larger market by being able to target the (now) minority of iOS device owners with hardware that doesn't support 2.0.

然而,OpenGL ES 2.0让你使用它的顶点和片段着色器比1.1做更多的事情,所以你可以使用广泛的几何体做的一些事情可以由着色器处理。这可以使效果更好,更快。

However, OpenGL ES 2.0 lets you do a whole lot more using its vertex and fragment shaders than 1.1 does, so some of the things that you might do with extensive geometry can instead be handled by shaders. This can make for better-looking, faster effects.

例如,我正在使用2.0着色器完成对分子渲染器的更新,这将显着提高可视化的分辨率结构。我这样做是通过使用自定义着色器为这些结构中的球体和圆柱体生成光线追踪冒名顶替者。在任何放大倍率下,这些物体看起来都非常圆润。在具有纯几何的OpenGL ES 1.1中执行此操作几乎是不可能的,因为所需的三角形数量将是荒谬的(同样,广告牌对我的圆柱体不起作用,并且这些形状的交集将无法正确处理那种情况)。

For example, I'm finishing an update to my molecular renderer using 2.0 shaders that will significantly increase resolution of the visualized structures. I'm doing this by using custom shaders that generate raytraced impostors for the spheres and cylinders in these structures. These objects look perfectly round and smooth at any magnification. Doing this in OpenGL ES 1.1 with pure geometry would be all but impossible, because the number of triangles required would be ridiculous (also, billboards wouldn't work well for my cylinders, and the intersection of these shapes wouldn't be handled right in that case).

这些设备可能有一百万个三角形。在我的基准测试中,旧的iPhone 3G每秒大约有500,000个三角形,第一代iPad大约有2,000,000个。我还没有对速度更快的iPad 2进行全面测试,但我早期的测试表明它每秒大约有8,000,000到10,000,000个三角形。即使在那里最快的设备上,你也只能在最好的设备上获得百万三角形场景的~10 FPS。可能的情况是,你不需要那么几何尺寸,所以我会尽我所能来减少几何尺寸。

A million triangles might be a bit much for these devices. In my benchmarks, the old iPhone 3G did around 500,000 triangles per second, and the first-generation iPad about 2,000,000. I haven't fully benchmarked the much faster iPad 2, but my early tests show it at about 8,000,000 - 10,000,000 triangles per second. Even on the fastest device out there, you're only going to get ~10 FPS on a million-triangle scene in the best of the devices. Odds are, you don't need that size of geometry, so I'd do what I could to reduce that first.

这篇关于OpenGL-ES 2.0 VS OpenGL-ES 1.1,哪个更快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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