Monday, October 17, 2011

WebGL in Internet Explorer

Currently, even Internet Explorer 10 will not support WebGL. Meanwhile, all the other major browsers support this new standard. I'm still confident that Microsoft will add WebGL support to IE, but as WebGL developers what can we do in the meantime?
  • Chrome Frame - an IE plugin that uses the Chrome engine to render web-pages that request so. If an IE user has this plugin installed, all we need to do is include a single meta tag in our WebGL-enabled pages:
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    The major downside is Chrome Frame is a plugin, and, therefore, requires an install.  However, we don't need administer privileges to install Chrome Frame, making this option very attractive.
  • IEWebGL - an IE plugin that implements WebGL. It is lightweight, and was fairly simple to port our large engine to. Unlike Chrome Frame, IE's JavaScript engine still runs our JavaScript, and only the WebGL calls are forwarded to the plugin. The advantage over Chrome Frame is the install is smaller.
  • jebgl - uses a Java applet to emulate WebGL in IE by forwarding WebGL calls to JOGL. This sounds really promising because it does not require installing a plugin. Unfortunately, I have not been able to get it to work.
  • webgl-compat - a work-in-progress that implements WebGL with Canvas. I can't imagine that this is going to perform well. The first proof-of-concept rendered 25 rotating triangles at 42 fps without depth testing. Today's hardware pushes billions of triangles per second.
  • cwebgl - implements WebGL using JavaScript and Canvas, similar to webgl-compat. Again, I don't think this will meet the performance needs of most applications.
Today, I think our best bet is to use Chrome Frame. It worked well in my tests, can be installed without admin privileges, and supports even IE6 (admittetly, I only tested using IE9). Even when IE supports WebGL, we will need to consider these options for our users who can't upgrade right away.