基本注意事項
轉貼自 http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008793-CH1-SW1
在OPENGLES 中 1. 1會提供許多數學運算的function,但在2.0後,這些運算function需要使用者自行提供。可參考網址中所提供的Library
http://kirenenko-tw.blogspot.tw/2013/06/xcode-math-library.html
EAGL
Tiny glue API between OpenGL ES and UIKit. Some EAGL classes (such as CAEGLLayer) are defined in Quartz Core framework, while others (such as EAGLCon text) are defined in the OpenGL ES framework.
1. OpenGL ES is a C-based, Platform-Neutral API
Because OpenGL ES is a C-based API, it is extremely portable and widely supported. As a C API, it integrates seamlessly with Objective-C based Cocoa Touch applications. The OpenGL ES specification does not define a windowing layer; instead, the hosting operating system must provide functions to create an OpenGL ES rendering context, which accepts commands, and a framebuffer, where the results of any drawing commands are written to.2. OpenGL ES is Integrated into Core Animation
Core Animation is fundamental to iOS graphics, and that includes OpenGL ES content that your application delivers to the screen. When you develop an OpenGL ES application, your OpenGL ES content is rendered to a special Core Animation layer, known as aCAEAGLLayer object. The images you render using OpenGL ES are stored in the CAEAGLLayer. Core Animation composites these images with content in other layers and delivers the final image to the screen.3. Framebuffer Objects are Always the Rendering Destination
The OpenGL ES specification assumes there are two kinds of framebuffers: system-provided framebuffers and framebuffer objects. A system framebuffer is allocated using an API provided by the host operating system, and connects to the screen or windowing environment. Framebuffer objects target offscreen rendering without a direct connection to the screen or windowing environment. iOS only uses framebuffer objects; rather than create a separate system framebuffer, iOS extends the OpenGL ES API to allow a framebuffer object to be allocated so that its contents are shared with Core Animation.4. Functionality May Vary on Different Devices
這一段基本不用看,因為新版的IOS都會支援ES2.0,因此不需注意ES1.0的相容性。5. Applications Require Additional Performance Tuning
Graphics processors are parallelized devices optimized for graphics operations. To get great performance in your application, you must carefully design your application to feed data and commands to OpenGL ES so that the graphics hardware runs in parallel with your application. A poorly tuned application forces either the CPU or the GPU to wait for the other to finish processing commands.You should design your application to efficiently use the OpenGL ES API. Once you have finished building your application, use Instruments to fine tune your application’s performance. If your application is bottlenecked inside OpenGL ES, use the information provided in this guide to optimize your application’s performance.
Xcode 4 provides new tools to help you improve the performance of your OpenGL ES applications.
6. OpenGL ES May Not Be Used in Background Applications
Applications that are running in the background may not call OpenGL ES functions. If your application accesses the graphics processor while it is in the background, it is automatically terminated by iOS. To avoid this, your application should flush any pending commands previously submitted to OpenGL ES prior to being moved into the background and avoid calling OpenGL ES until it is moved back to the foreground.7. OpenGL ES Places Additional Restrictions on Multithreaded Applications
Designing applications to take advantage of concurrency can be useful to help improve your application’s performance. If you intend to add concurrency to an OpenGL ES application, you must ensure that the application does not access the same context from two different threads at the same time.Relevant Chapters: “Concurrency and OpenGL ES”


沒有留言:
張貼留言