Relationship between OpenGL ES and EGL

OpenGL is a multi-platform API for rendering 2-D and 3-D graphics. The API interacts with the GPU to provide rendering of hardware-accelerated graphics. It's an API that is independent of the windowing and operating systems, and is network-transparent.

OpenGL ES is the embedded system version of the OpenGL API, and is used for mobile devices and other embedded software systems. There are several versions of OpenGL ES available and each version specification corresponds to an OpenGL version specification. So, OpenGL ES 1.1 is defined relative to OpenGL 1.5 and OpenGL ES 2.0 corresponds to OpenGL 2.0 specification. This means that porting code to and from these two corresponding APIs is simpler than porting code from two non-matching APIs.

EGL is an interface between OpenGL ES and the native windowing system. EGL creates rendering surfaces and contexts for OpenGL ES to draw to. The BlackBerry 10 OS and BlackBerry PlayBook OS both support EGL version 1.4.

Selecting a version that BlackBerry 10 supports

  • OpenGL ES 1.1

    OpenGL ES 1.1 uses a fixed-function rendering pipeline, which allows you to render graphics using traditional lighting and shading models. It is defined relative to the OpenGL 1.5 specification and is fully backwards-compatible to OpenGL ES 1.0. You can configure stages of the pipeline for specific tasks or disable stages as required.

  • OpenGL ES 2.0

    OpenGL ES 2.0 uses a programmable rendering pipeline, which allows you to create shader and program objects as well as write vertex and fragment shaders in the OpenGL ES Shading Language. This implementation uses similar functions as version 1.1 but does not support the fixed function transformation and fragment pipeline.

  • OpenGL ES 3.0

    OpenGL ES 3.0 also uses a programmable rendering pipeline and adds features and improvements over version 2.0. These include supporting new buffer formats and texture features, adding occlusion queries and geometry instancing, and providing a new version of the OpenGL ES Shading Language. OpenGL ES 3.0 is backward compatible with version 2.0.

Only the BlackBerry Z30 smartphone supports OpenGL ES 3.0.

When you design your application, you need to decide which API version you want to use: 1.1, 2.0, 3.0, or a combination of versions. When you make this decision, you should consider the needs of the application and what you're comfortable with. If your graphical models are simple and do not require anything fancy, you should consider OpenGL ES 1.1. Developers who are new to OpenGL may find coding in OpenGL ES 1.1 faster and more convenient.

OpenGL ES 2.0 is more flexible and more powerful than 1.1. Also, the vertex and fragment calculations in version 2.0 have better performance. However, the OpenGL ES 2.0 API is more work up front, such as programming the shaders, and you need to re-create some of the pipeline that version 1.1 provides by default.

OpenGL ES 3.0 is the latest version of the API and improves upon 2.0 in a number of ways. The rendering pipeline has been enhanced to enable acceleration of visual effects through occlusion queries, transform feedback, and instanced rendering. ETC2/EAC texture compression is standardized, eliminating the need for different sets of textures for different platforms. There is also a new version of the OpenGL ES Shading Language that supports integer and 32-bit floating point operations.

Architecture: OpenGL ES in BlackBerry 10

In BlackBerry 10 OS, OpenGL ES is leveraged extensively through several development frameworks, such as the Cascades UI Framework, the BlackBerry 10 WebWorks SDK, and more. We'll take a brief look at how OpenGL ES is used in each SDK. Architecture diagram of OpenGL ES on BlackBerry 10

The BlackBerry 10 architecture is built on the QNX Neutrino RTOS. The QNX Neutrino RTOS includes a window compositor that performs various transformations on windows and blends windows together. The compositor is optimized for BlackBerry 10 and leverages the graphics hardware where ideal.

The WebKit engine powers the BlackBerry WebWorks SDK and uses both the 2-D and 3-D hardware for rendering.  Cascades UI Framework is based on Qt and exposes a set of C++ APIs for building UIs and animations.  It also exposes various C++ APIs that lets you access platform features.  Cascades is based on a client-server architecture and uses OpenGL ES as its rendering engine. The BlackBerry Runtime for Android apps uses the Skia 2-D engine and OpenGL ES for rendering and accelerated compositing.

Last modified: 2014-09-30

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus