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.

7 comments:

  1. Chrome Frame doesn't require admin privleges since June: http://blog.chromium.org/2011/06/introducing-non-admin-chrome-frame.html

    ReplyDelete
  2. I would think now that Flash 11 has OpenGL ES 2 compatible 3D and quickly achieves >90% penetration, a Flash version or shim would be the best option.

    ReplyDelete
  3. Interesting point about Flash. I'm curious to see if anyone takes that approach.

    ReplyDelete
  4. http://www.ambiera.com/copperlicht/demos.html

    They did, apparently...

    Flash demos did not work for me, although the webgl ones did.

    Presumably some detector could choose the appropriate tech as needed.

    I guess the disadvantage of all plugin based approaches
    (flash, java) is that the webgl canvas is not integrated
    into the page/DOM. For some webgl uses, that could be problematic.

    ReplyDelete
  5. The Flash demos worked nicely for me. I believe this is separate WebGL and Flash engines, not WebGL implemented on top of Flash.

    ReplyDelete
  6. Huh. From reading the site I gathered it was write once, then compile to flash or webgl.

    Which does not seem an unreasonable approach for standalone apps.

    If you're going to want to integrate with a site, seems to me that any plugin - flash, silverlight, java - is a poor choice.

    ReplyDelete
  7. Right. I'm pretty sure that is how it works as well.

    ReplyDelete