There are some API changes coming in WebGL, which will probably require pretty much all of the WebGL content out there to be modified; the changes are likely to go live in Minefield in a week or two, so we need to get moving! Vladimir Vukićević and Benoit Jacob have given the details in two posts on the public WebGL mailing list. Here’s a summary:
- Fragment shaders will now be validated to make sure that they are correct for WebGL / OpenGL ES; previously you could get away with using quite a lot of desktop OpenGL stuff, in particular missing out the mandatory precision specifier in fragment shaders (see the mailing list for details and a fix from Vladimir). In the short term, whether or not this validation happens will be optional, decided by the brower’s user, and off by default. However, it will become mandatory, so you should switch it on now to test your content. To switch it on:
- In Minefield, go to
about:configand changewebgl.shader_validatorto true. - In Chromium, pass
--enable-glsl-translatorin on the command line. - There are no details on how to do it in WebKit yet.
- In Minefield, go to
- The
gl.texImage2Dfunction has changed its signature. Brandon Jones posted about this the other week, noting that Chromium warnsyou when you use the old form; both old and new forms of the function have been supported by the browsers for a while, but the old one will soon be gone. - As Andor Salga mentioned recently,
gl.readPixelshas also changed.
So, I’m going to go through all of my demos and tutorial code and change to the new APIs; if you have WebGL content live on the Web, you should too!

