This is great, a single standard being implemented in WebKit AND Firefox. Someone will probably have to write a plugin for IE though, since it's HIGHLY doubtful Microsoft would cooperate.
We've got just about everyone EXCEPT the major browser vendor working on cool, useful, forward-thinking innovations, and standardizing on them with relative ease. Yet all of this innovation is so sorely limited without Microsoft's contribution (to IE).
Normally I just nod my head and move on, but the future doesn't look any brighter for IE. Hopefully Microsoft's halfhearted interest in HTML5 will improve.
But then again, MS could drop WebKit into IE9, and we'd still be stuck, unless Microsoft shoves IE9 down the Automatic Update pipeline as a required update. Which they should, IMHO. Progress is worth some pain.
We've got just about everyone EXCEPT the major browser vendor working on cool, useful, forward-thinking innovations, and standardizing on them with relative ease. Yet all of this innovation is so sorely limited without Microsoft's contribution (to IE).
Microsoft's ActiveX has been around for a long time. And I remember a little something called VRML that was supported by the major browsers of the time.
I'm looking more for something community-or-compatibility driven. The web community pushes for certain things; when everyone except IE gets on board, Microsoft should strive to pursue those standards.
Poor word choice on my part: Microsoft has innovated before, yes. They're innovating now in various spaces. But they're dragging their feet in areas that could really boost the web as a platform, and that slows progress.
1994, and SGI IRIX already shipped with browser plugin for 3D and 3d content creator. even the lowly 8bit indy could handle it. VRML at it's best (if it had any best...)
The 5.3 or 6.2 version of Irix (do not recall which one, the one that shipped with netscape 2.0) also had all the admin apps written in html+javascript, but completely merged with the OS look n feel. you simply couldn't tell.
Try using "for in" to iterate through the returned canvas's properties. You'll get all the methods of the canvas. So far this sort of stuff works (OSX Leopard): gl.clearColor(0,0,0,0);
gl.clear(gl.COLOR_BUFFER_BIT);
I just got back, and I'm needing to look at the google cache of almost every mozilla forum page; I haven't gotten through to their forums a single time yet.
Their 'search moz code' thingy still works -- searching it for WebGL turns up lots ... I mean LOTS ... of code. But even though I've found a list of enums for contexts, etc, I still haven't quite found where the mapping is, or where the actual base getcontext() function is located.
I have powerful procrastination forces pushing me, though.
Does the FF nightly work for you? It doesn't for me at the moment, at least not with those samples (link to my post below, in case this discussion gets big: http://news.ycombinator.com/item?id=831988).
Any tips appreciated. I'll have a few hours free this afternoon, so I may muck around with this!
I'll edit this to update on problems as they come. For people trying to run the existing webgl samples (using something like utils3d.js) that are out there with the nightly ff build:
1) canvasElement.getContext("moz-webgl"), not "webkitwhatever"
(Conflicts w/presentation slides pdf on the khronos site, which says "3D" with a capital D)
That's how far I've gotten so far.
Much more perplexing to me is a case where their code seems (I want to stress, seems!; maybe it's staring me in the face and I just don't get how they changed it) to break an opengl function: glBindBuffer. http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
The specs say, call glBindBuffer with (arg, arg2), and arg2 will be an unsigned int which refers to a buffer.
The reference above says, calling it with an arg2 of 0 and it'll reset. The webkit examples use it this way. But, their implementation of the wrapped BindBuffer method doesn't like this; if you pass in 0, it gives you an error that suggests you mean null. Pass in null, and there's an uncaught exception and an error in glBufferData, telling you that, surprise, you want an Unsigned Short.
The typing of the args won't let you pass in a zero, and the typing on the constructor for the cast is what kills it if you pass in a javascript null (it wants an integer).
And if you try to instantiate a WebGLBuffer instance with javascript -- whose constructor expects an int -- it won't let you.
nbuf = new WebGLBuffer(0);
-> [Exception... "Cannot convert WrappedNative to function"...
You could try calling glGet... on the buffer early on, caching the default value it returns to you and then using that to invoke bindBuffer (just to be sure you're not calling it with something it shouldn't understand) but this doesn't wrap opengl directly enough; it's just whatever you see implemented here (http://mxr.mozilla.org/mozilla-central/source/content/canvas...). Some functions, like bindbuffer, are implemented. The others are named very differently, and look like this: