选择 OpenGL ES 1.1 还是 OpenGL ES 2.0? [英] Choose OpenGL ES 1.1 or OpenGL ES 2.0?

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

问题描述

我将开始一个新的跨平台 openGL 项目(主要用于 iPhone 和 PC).所以有一个主要问题:针对 OpenGL ES 1.1 还是 OpenGL ES 2.0?或两者?到目前为止,我读到 Open GL ES 1.1 并没有真正被弃用,不是吗?那么,openGL ES 2.0 的意义何在?可编程顶点-&碎片着色器——还有别的吗?我听说 alpha 混合会降低性能 - 这是真的吗?我假设 openGL ES 2.0 代码也应该在 PC 上运行 - 那么 openGL ES 2.0 真的更具有未来意识吗?

I'm going to start a new cross-plattform openGL project (primary for iPhone & PC). So theres the main question: targeting for OpenGL ES 1.1 or OpenGL ES 2.0? Or both? So far I read Open GL ES 1.1 isnt really deprecated, isn't it? So what would speak for openGL ES 2.0? Programmable vertex- & fragmentshader - Anything else? I heard about performance decrease with alpha blending or so - can that be true? I assume openGL ES 2.0 code should also run on PC - So is openGL ES 2.0 is really more future aware?

其他开发人员仍在为 OpenGL ES 1.1 或 2.0 编写代码?为什么?我假设如果我选择 openGL ES 2.0,那么与 openGL ES 1.1 的向后兼容性也会有很多开销.但是有很多 iPhone 没有 openGL ES 2.0 支持——我应该如何做到这一点?有什么经验吗?

The other developers out there are still coding for OpenGL ES 1.1 or 2.0? And why? I assume in case I choose openGL ES 2.0, there would be a lot of overhead for also backward compatibility with openGL ES 1.1. But there are a lot of iPhones out there without openGL ES 2.0 support - how should I accomplish this? Any experience out there?

我只发现了这个问题:OpenGL ES 1.1 or 2.0在 iPhone 上有点相关,但它的实现并不深入......所以欢迎任何建议!非常感谢!

I found only this question: OpenGL ES 1.1 or 2.0 on iPhone kind of relevant, but it isn't really deep about the implementation... So any advice is welcome! Thank you so much!

推荐答案

使用 OpenGL ES 1.1 还是 2.0 取决于你想在你的应用程序中做什么,以及你需要它兼容多少设备.所有 iOS 设备都支持 OpenGL ES 1.1,其中只有 iPhone 3GS 和更新的设备(iPhone 3GS、iPhone 4、iPad 和第 3 代和第 4 代 iPod touch)支持 OpenGL ES 2.0.但是,Apple 当前发布的所有 iOS 设备都与 OpenGL ES 2.0 兼容.不支持 OpenGL ES 2.0 的设备百分比每天都在下降.所有 iPad 从发布之日起就支持 OpenGL ES 2.0,因此如果您以该外形尺寸为目标,您一定会获得支持.

Whether to use OpenGL ES 1.1 or 2.0 depends on what you want to do in your application, and how many devices you need it to be compatible with. All iOS devices support OpenGL ES 1.1, where only the iPhone 3G S and newer devices (iPhone 3G S, iPhone 4, iPad, and 3rd and 4th generation iPod touch) support OpenGL ES 2.0. However, all iOS devices Apple is currently shipping are compatible with OpenGL ES 2.0. The percentage of devices that don't support OpenGL ES 2.0 is dropping every day. All iPads have supported OpenGL ES 2.0 from launch, so you're guaranteed to have support if you target that form factor.

OpenGL ES 2.0 和 1.1 使用不同且相当不兼容的渲染管道.OpenGL ES 1.1 使用固定功能管道,您可以在其中输入几何和纹理数据,设置光照等状态,并让 OpenGL 为您处理其余部分.OpenGL ES 2.0 基于可编程管道,您可以在其中提供顶点和片段着色器来处理如何将内容渲染到屏幕的细节.

OpenGL ES 2.0 and 1.1 use different and fairly incompatible rendering pipelines. OpenGL ES 1.1 uses a fixed function pipeline, where you feed in geometry and texture data, set up lighting, etc. states, and let OpenGL handle the rest for you. OpenGL ES 2.0 is based around a programmable pipeline, where you supply vertex and fragment shaders to handle the specifics of how your content is rendered to the screen.

因为您必须编写自己的代码来替换最基本的内置函数,所以将 OpenGL ES 2.0 用于简单的 3-D 应用程序可能比 OpenGL ES 1.1 需要更多的努力.此外,您在那里发现的大多数示例应用程序和文章都面向 1.1,因此开始使用 2.0 API 可能会更加困难.

Because you have to write your own code to replace even the most basic built-in functions, using OpenGL ES 2.0 for simple 3-D applications may require more effort than OpenGL ES 1.1. Also, most sample applications and writeups that you find out there will be geared toward 1.1, so it can be more difficult to get started with the 2.0 API.

然而,您可以编写自己的例程来处理您的几何体和纹理以及它们如何显示在屏幕上,这意味着 OpenGL ES 2.0 可以让您做一些根本不可能的事情(或者需要大量大量的努力)在 OpenGL ES 1.1 中完成.其中包括卡通着色和环境光遮蔽照明等效果,以及让您做一些有趣的事情,例如将大量并行工作卸载到 GPU.

However, the fact that you can write your own routines for dealing with your geometry and textures and how they are displayed to the screen means that OpenGL ES 2.0 lets you do things that simply would not be possible (or would require a tremendous amount of effort) to do in OpenGL ES 1.1. These include effects like cartoon shading and ambient occlusion lighting, as well as letting you do something interesting like offloading massively parallel work to the GPU.

如果您想查看一些使用 OpenGL ES 2.0 可以做什么的示例,请查看我教授的有关该主题的课程的视频在 iTunes U 上,我创建了两个示例应用程序 这里这里.

If you care to see some examples of what you can do with OpenGL ES 2.0, video for the class I taught on the subject is available on iTunes U, and I created two sample applications here and here.

在跨平台兼容性方面,着色器在桌面 OpenGL 上已经有一段时间了,所以您使用 OpenGL ES 1.1 或 2.0 构建的任何东西都应该相当可移植到桌面.

When it comes to cross-platform compatibility, shaders have been available on desktop OpenGL for a little while now, so anything you build using either OpenGL ES 1.1 or 2.0 should be fairly portable to the desktop.

如果您可以在 OpenGL ES 1.1 中进行所需的渲染,则可以采用这种方式来提供最大的设备兼容性.但是,当今使用的绝大多数 iOS 设备都支持 OpenGL ES 2.0(我现在找不到这方面的统计数据,但它是基于出货量的),而且这个数字只会随着时间的推移而增长.OpenGL ES 2.0 让您可以实现一些令人惊叹的效果(请参阅 Epic Citadel),这些效果可以帮助您将您的应用程序与其他应用程序区分开来.

If you can do the rendering that you want in OpenGL ES 1.1, you could go that way to provide the maximum device compatibility. However, a significant majority of iOS devices in use today support OpenGL ES 2.0 (I can't find the statistics on this right now, but it was based on units shipped), and that number will only grow over time. OpenGL ES 2.0 lets you pull off some stunning effects (see Epic Citadel) that could help you set your application apart from the others out there.

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

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