Wednesday, November 11, 2009

WebGL updates

I have several links to share.

Yohei Shimomae updated his Cube Defense game demo to work on Firefox. I think this is the first fully-playable WebGL game I've seen. This is pretty encouraging to see without any documentation and I hope to see many more of these. There are some confusing comments about the WebGL arrays on his blog, though. WebGL introduces types for handling native arrays from JavaScript. Vlad wrote up some info about the rationale for them and explains how they're used.


Cube Defense

A couple of libraries have appeared to simplify writing applications that use WebGL: C3DL and WebGLU. C3DL has been around for almost 2 years now and has recently been ported to WebGL. A demo of the port is here.


C3DL Orbiter

Since there isn't any real documentation on WebGL so far, getting even this far takes some digging and patience. Giles Thomas created a blog about WebGL with very detailed lessons based on the NeHe OpenGL lessons. Giles updates pretty regularly with new lessons (7 so far!) and demos. He also fairly impressively stays on top of other new demos and WebGL things so his blog is good to watch if you're interested in WebGL. The previous warning still applies: WebGL is still changing. Until the spec is finalized, lessons and demos are likely to break. Expect some updates on this in a few weeks.

While Giles does a pretty great job of collecting links, Chris Blizzard set up a planet site for WebGL which includes his and other blogs of people posting about WebGL. If you know of someone else or are someone with a blog about WebGL, let Chris know and get it added to the site.

2 comments:

Giles said...

Hey Mark,

Thanks for mentioning Learning WebGL! One question -- you say that Yohei's blog post has some confusing points about arrays. I noticed that he says you should "use ARRAY_BUFFER rather than ELEMENT_ARRAY_BUFFER", which does sound a bit odd (like he's confusing arrays of vertex data with arrays of vertex indices), but he also mentions that you should "use WebGLFloatArray instead of CanvasFloatArray". I spotted a Twitter message from (I think) a WebKit developer saying that he was renaming CanvasXXXArray to WebGLXXXArray in WebKit to adjust to a change in the spec. Is that bit correct? -- that is, are the classes being renamed? Or is there something I'm missing here? I don't think Vlad mentioned anything about the WebGL prefix.


Cheers,

Giles

Mark said...

Right, the prefixes are changing, but only one or the other will work. WebKit changed the names this week to the WebGLXXXArray style. Firefox will change back to WebGL-prefixed names soon too. He may have been referring to that.