(Guest Post) Overview of WebGL

WebGL logo

WebGL code snippet

This is a guest post by Cédric Pinson. If you want to guest post on this blog, just contact us.

For people who aren’t familiar with it, WebGL is a javascript binding of OpenGL ES 2.0 and will be available in future browsers. It is actually already available through the developers / nightly build: Getting a WebGL Implementation. Right now, only Safari / Firefox / Chrome implement WebGL. There is still no implementation for IE.

Why WebGL?

This technology seems to be the next big thing in browser technology. Why ? Because you will be able to run opengl applications (game / tools / simulation) in browser without installing plugin. This technology is ‘compatible’ with mobile device because they already have OpenGL ES 2.0 capability. For example Nokia 900 is able to run WebGL with firefox mobile. Have a look here:

So soon it’s possible we will see WebGL on most mobile devices. The links below show some people are starting to do build SceneGraph / GameEngine /… that target WebGL:

As mentioned previously WebGL is based on OpenGL ES 2.0 specification, meaning it works only with shaders and dropped fixed function pipeline. The main problem is that you can quickly hit the javascript speed execution even though javascript is improving. In javascript performance related to cpu are far from what we know with C/C++. As a consequence the main bottleneck is the cpu, you can display huge mesh with a lot of triangles but have less cpu power for logic or computation due to javascript. Something that might help would be OpenCL ES in the browser.

For more information here are some links that you can bookmark. You can follow WebGL activity at Planet WebGL, it’s often updated with cool WebGL stuff. Additionally, you can find NeHe tutorials at Learning WebGL.

Some tests I have done:

WebGL Particles

WebGL + OpenSceneGraph
WebGL OpenSceneGraph

About the author: Cedric M. Pinson has twelve years of experience in 3D software. He has worked in the video game industry at Nemosoft and Mekensleep, before joigning OutFlop, where he has served as the project leader for the 3D client technology. He is a contributor to the OpenSceneGraph project and the author and maintainer of osgAnimation. He now does freelance work around OpenGL technologies such as OpenSceneGraph and WebGL.


↑ Grab this Headline Animator