Choose OpenGL ES 1.1 or OpenGL ES 2.0?

2019-01-16 11:58发布

问题:

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?

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?

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!

回答1:

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 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.

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.

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.

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.

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.

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.



回答2:

Basically only the iPhone 3G and prior (discontinued 2010) and iPod 2nd generation and earlier (also discontinued Sept 2010) need you to use OpenGL ES 1.0.

All iPads, iPad minis, and iPhones 3GS onward, support OpenGL ES 2.0. In fact, any iOS device sold (as a brand new device) after Sept 2010 supports OpenGL ES 2.0.

OpenGL ES 3.0 support

Not only do you get ES 2.0 support, but the iPhone 5S + iPad Air (iPad 5th generation) now OpenGL ES 3.0, as of Nov 2013.



回答3:

Currently, I seriously doubt there's any device out there that doesn't support OpenGLES 2.0! Put in a little more effort into OpenGLES 2.0, and you'll be future-proof, especially since OpenGLES 3.0 is out. Actually, I found OpenGLES 2.0 easier than 1.1, simply because I can perform my own matrix calculations and specify exactly what goes into a shader.

The other thing is, if you're going to use OpenGLES 1.1 API, you need to know that it's actually implemented as a shader, and that it's not a hardware thing, if that makes sense. OpenGLES 2.0 runs a vertex shader that implements an OpenGLES 1.1 fixed function pipeline.

It's a no brainer -- OpenGLES 2.0 at least!



回答4:

I have chosen 2.0 just for Cubemap