Computer Graphics World

April 2011

Issue link: https://digital.copcomm.com/i/30784

Contents of this Issue

Navigation

Page 20 of 51

Web Graphics n n n n body, was coalescing out of the gaseous ball of confusion around standards for devices, espe- cially the just-emerging smartphones. Today, the Khronos Group has a number of Applica- tion Programming Interfaces (APIs) that en- able dynamic media on a wide range of devices and across operating system platforms. Their APIs are open-standard and royalty-free. Setting Standards The world can be divided into two kinds of people. One kind looks at smartphones and says, “This will be a great thing to have in emergencies.” The other kind says, “Hey! Can I play Quake on this thing?” There are a lot of group 2 types in the Khronos organization. One of Khronos’ first jobs was to take the big, all-encompassing OpenGL standard and streamline it for devices—and that became the OpenGL ES standard. OpenGL ES is now the standard for consoles, mobile devices, and Apple’s OS X and iOS; PC apps are very comfortable working within the OpenGL ES envelope, as well. The current standard in this area is OpenGL ES 2.0, which brings programma- bility and hardware acceleration. Because it is programmable, OpenGL ES supports the transform and lighting capabilities available to developers in OpenGL via the ability to write shaders. Essentially, the Khronos Group has been able to take the best of OpenGL and distill it into a compact API that makes 3D hardware acceleration possible on all devices that support it. Web APIs The next step has been to develop an API for Web browsers. The Khronos Group first an- nounced WebGL at SIGGRAPH 2009 in New Orleans. Over the next year and a half, the group hammered out a standard designed for the next generation of Web browsers com- ing as a result of the work on HTML 5 be- ing done by the W3C standards body. The two groups are not affiliated, but their work is complementary. The WebGL working group—which in- cludes representatives from AMD, Ericsson, Google, Mozilla, Nvidia, and Opera—has integrated almost all of OpenGL ES 2.0 into the WebGL API. Mozilla’s Vladimir Vukićević, head of the WebGL working group, says, “Web- GL tracks OpenGL ES 2.0 almost directly.” Vukićević notes that there were some changes made because features in OpenGL ES didn’t make sense for the platform. The group opted to use JavaScript in compliance with HTML 5, so mechanical changes were made Pictured here is a 3D aquarium by Human Engines and Gregg Tavares. The control panel shown on the left allows you to increase the number of fish and change camera views. The demo shows off textures, animation, pixel-shader animation, reflections, refraction, and caustics. to accommodate JavaScript. Features and re- strictions were added for security. And, says Vukićević, “OpenGL ES, because it’s focused on performance, leaves edge cases undefined. In WebGL, we tried to make [the ones we caught] have precise behavior.” It is an integral part of Khronos’ mission that its APIs be cross-platform so WebGL runs everywhere. “There have been many at- tempts for platform portability,” acknowl- edges Vukićević. “What we’ve learned is that the hardware OS vendors hate cross-platform tools, but the irony is that they’re supporting HTML 5 functionality—the ultimate porta- bility tool.” Like so many things in this world, it is as important for the time to be right as it is for the technology to be available. To this end, HTML 5 is enabling the arrival of the next generation of browsers, and in developing WebGL, the working group has been careful to ensure compatibility with HTML 5. WebGL complies with HTML 5 in its use of the “canvas” element for graphics. The can- vas element, along with video and audio, are defined as part of the HTML 5 DOM (Docu- ment Object Model). HTML 5 defines can- vas as “a resolution-dependent bitmap canvas that can be used for rendering graphics, game graphics, or other visual images on the fly.” With WebGL support in browsers, it also can be used as a space for 3D graphics. A Web page can have one canvas area or several, or it can be the entire page. When WebGL is sup- ported by a browser, no plug-ins are needed to view the content. There has been some questioning of the use of JavaScript to implement WebGL in browsers because Java carries with it the stigma of overhead. This, too, is a matter of timing as well as standards. Neil Trevett, Khronos presi- dent, contends that given the pace of hardware improvements, the complaint about JavaScript is no longer relevant. “The hardware is already fast enough, and it’s just going to get better,” he April 2011 19

Articles in this issue

Archives of this issue

view archives of Computer Graphics World - April 2011