OpenGL Insights
Cover Table of Contents Pipeline Map Tips Contributors Reviews BibTeX Errata Code Blog Buy

VII Software Design

Developers work with OpenGL at many levels of the software stack. Some developers create OpenGL implementations by writing drivers or, as we will see, using another graphics API; other developers create middleware or engines that simplify the use of OpenGL and raise the level of abstraction; and perhaps the majority of OpenGL developers create actual applications, whether by directly calling OpenGL or by using OpenGL-based engines. In this section, we look at software design at each layer of this stack. We consider implementing OpenGL ES 2.0, engines and applications built on WebGL, making legacy OpenGL code modern, and building cross-platform OpenGL applications.

ANGLE, or the Almost Native Graphics Layer Engine, provides an OpenGL ES 2.0 implementation using Direct3D 9. It is used as the default WebGL backend for Chrome and Firefox on Windows. Implementing ANGLE is not nearly as simple as converting OpenGL calls to Direct3D calls; the differences in capabilities of the APIs need to be taken into account. In Chapter 39, "The ANGLE Project: Implementing OpenGL ES 2.0 on Direct3D," Daniel Koch and Nicolas Capens discuss the implementation challenges in ANGLE, provide performance results, and suggest recommended practices.

Given how low-level WebGL is compared to other web APIs, it was clear from its start that there would be demand for higher-level 3D engines built on WebGL. Here, we look at two such engines. SceneJS is an open-source 3D engine, based on a scene graph optimized for rendering large numbers of individually pickable and articulated objects. In Chapter 40, "SceneJS: A WebGL-Based Scene Graph Engine," Lindsay Kay presents SceneJS' architecture and how it makes efficient use of JavaScript and WebGL.

SpiderGL is another 3D graphics library that uses WebGL. Instead of providing higher-level constructs like a scene graph, SpiderGL provides utilities, data structures, and algorithms to simplify WebGL development but still allows the use of other WebGL code in the same application. In Chapter 41, "Features and Design Choices in SpiderGL," Marco Di Benedetto, Fabio Ganovelli, and Francesco Banterle discuss some design and implementation decisions in SpiderGL including its model representation and allowing seamless interoperability with naive WebGL calls.

WebGL is enabling a whole new class of applications. In Chapter 42, "Multimodal Interactive Simulations on the Web," Tansel Halic, Woojin Ahn, and Suvranu De present a framework for visualization, simulation, and hardware integration for multimodal interactive simulations using WebGL. Think practicing surgical procedures using a web browser!

Maintaining legacy and modern OpenGL code in the same code base can prove challenging. Jesse Barker and Alexandros Frantzis share their experiences in Chapter 43, "A Subset Approach to Using OpenGL and OpenGL ES." They suggest ways to move to a single modern code base written against both OpenGL and OpenGL ES.

In "The Build Syndrome," the final chapter of this section and of the book, Jochem van der Spek and Daniel Dekkers discuss in detail building cross-platform OpenGL applications with C++/Objective-C and CMake.


39. The ANGLE Project: Implementing OpenGL ES 2.0 on Direct3D
Daniel Koch and Nicolas Capens
WebGL
OpenGL ES

...

code


40. SceneJS: A WebGL-Based Scene Graph Engine
Lindsay Kay
WebGL

...

code


41. Features And Design Choices in SpiderGL
Marco Di Benedetto, Fabio Ganovelli, and Francesco Banterle
WebGL

...

code


42. Multimodal Interactive Simulations on the Web
Tansel Halic, Woojin Ahn, and Suvranu De
WebGL

...


43. A Subset Approach to Using OpenGL and OpenGL ES
Jesse Barker and Alexandros Frantzis
OpenGL
OpenGL ES

...

code


44. The Build Syndrome
Jochem van der Spek and Daniel Dekkers
OpenGL
OpenGL ES

...


Sections