WebGL


HelloRacer – a gorgeous WebGL demo from Carlos Ulloa

What is WebGL?

WebGL is an open standard graphics specification for the web. It’s based on an implementation of OpenGL|ES but designed for web browsers and controlled with JavaScript. It enables hardware-accelerated graphics to be drawn directly in the browser without the need for a third party plug-in. WebGL allows developers to create interactive and exceptionally fast 2D or super sophisticated 3D graphics using only a simple canvas HTML element in a web page.


Google Body – one of the WebGL Chrome experiments

Support

WebGL 1.0 is fully supported by most modern browsers, including:

Support for WebGL in Opera is apparently in the works. Microsoft have not announced any plans to support WebGL in Internet Explorer, although the IEWebGL plug-in is a decent workaround for now.

Mobile

Google Chrome and Safari are based on the open source WebKit project. Most modern ‘smartphone’ mobile browsers are also based on this, so it’s fairly safe to assume that WebGL will be implemented on these devices in the near future. However for now, WebGL is limited to desktop browsers.

Learning

WebGL is a very low-level computing language which means it’s not exactly easy to work with unless you’re a hardcore GPU programmer. Simply importing a 3D model and rendering it is quite a lengthy and complicated process! Higher level JavaScript libraries such as three.js simplify this process greatly, but much is still left up to the developer with regards to 3D modelling, lighting and the use of shaders etc.

To understand WebGL properly we recommend checking out the many great tutorial websites available, such as Learning WebGL or the official Khronos Group tutorial page.

Is WebGL safe?

Recent concerns about WebGL’s security were mostly about a bug in Firefox. But that’s nothing new — bugs in browsers (and in Adobe Flash Player) frequency cause security scares. Chrome engineer Gregg Tavares claims that these issues were overblown by Microsoft to provide an excuse for not supporting WebGL.

Although IE’s market share is (very slowly) diminishing, WebGL won’t reach as many people as quickly as the upcoming GPU-accelerated Flash Player, aka Molehill.

Future

We could now see in-browser MMOs like World of Warcraft appearing. Companies like Zynga have proved that there is money to be made in casual browser-based gaming so we may start to see more 3D games in that space. The mind boggles at the possibilities. We’ve only just begun!