3D on the Web

March 25th, 2009

Yesterday at the Game Developers Conference in San Francisco, Mozilla and the Khronos Group (the folks behind the OpenGL family of standards) announced a new initiative to bring accelerated 3D graphics to the web. This is a promising new direction for web applications, and adds to the rich mix of activities in forum such as the W3C and WHATWG to evolve the web platform.

JavaScript performance in all major browsers has shown marked improvements over time, paving the way for it to be used for more sophisticated classes of applications. Many graphics applications, including popular games, leverage hardware acceleration, and subsets of OpenGL (such as OpenGL ES1.1) are already available on smartphones. The initial activity proposal is to consider a simple binding of OpenGL ES2.0 to JavaScript, and exposing that to an HTML5 Canvas context. This is how a 2D drawing context is exposed to the web for use with a JavaScript API; the proposed mechanism is to do this for a 3D context as well. As exciting as this is for the web and for us at Mozilla, it’s worth explaining our choices, and raising some questions.

We chose Khronos to start with, since that’s the home of OpenGL, and the proposal is to start with an OpenGL subset such as OpenGL ES2.0. This is a very low-level API with a lot of C language structures, and perhaps an early task for the working group would be to figure out how to expose that to JavaScript. This isn’t a fait accompli, and we look forward to help and collaboration from other major players. Naturally, security is a paramount consideration. Google announced support for the activity, and we look forward to others doing so soon as well.

Would web developers actually use something this low level? While we anticipate the influx of a new type of web developer (who may also be a games developer, or interested in 3D visualization), it’s worth pointing out that a standardization principle that’s served the web well is to expose pretty low level primitives in browsers, and allow third party JavaScript libraries to take on the task of syntactic sugar and higher level abstractions. Applications toolkits such as dojo, jQuery, and Prototype simplify developers lives; the same can occur in the 3D arena.

It’s also worth pointing out that this endeavor with Khronos to bring a subset of OpenGL to the web is just the first step. Higher level APIs with retained mode graphics are likely to follow suit. The discussion officially started yesterday, so we’re glowing with fresh possibility in uncharted terrain here.

Also read Vlad’s thoughts on all this — he wrote the extension that was the initial experimental implementation, and made this happen. And Chris Blizzard’s thoughts.

5 Responses to “3D on the Web”

  1. Mardeg Says:

    Hopefully this will make it less of a pain to bring 3D to SVG than it took at:
    http://apike.ca/prog_svg_threed.html

  2. firefox.no » Mozilla igangsetter standardisering av 3D på web Says:

    [...] Mozilla har sammen med Khronos-gruppen (som står bak OpenGL) igangsatt et prosjekt for å utvikle en åpen standard for 3D-aksellerasjon på weben. Det framlagte forslaget går ut på å gjøre et API (programmerings-grensesnitt) for 3D tilgjengelig i Javascript på lignende måte som <canvas> nå gjør 2D-grafikk mulig. Vladimir Vukićević har allerede arbeidet med en eksperimentell utvidelse kalt Canvas 3D, som demonstrerer dette konseptet. Mer informasjon finnes på Mozilla Standards Blog. [...]

  3. Joshua Burkholder Says:

    The standard for 3D on the web is X3D – an XML based format. X3D supports animation, interactivity, scripting, extensibility, and a whole lot more, so it does everything you want it to do. Also, it’s been standardized, the specification and schema are published freely online, it has an active working group, and it is in version 3.2 (at the time I’m writing this), so it’s been well vetted. X3D currently requires a browser plugin (or standalone player); however, I’m sure that they would love to get native browser support. Closed source browser plugin implementations exist (such as Bitmanagement’s BS Contact, Octaga’s Octaga player, Instant Reality’s InstantPlayer, and …); however, open source implementations of X3D players also exist.

    Let me know if you want more information (there is a bunch of online documentation and videos describing the spec).

    No Need To Recreate The Wheel,
    Joshua Burkholder

  4. Mozilla and Khronos to bring standards-based 3D to the web | WinSoftNews - Computers-Technology-Software Says:

    [...] layers on top of the standard APIs to provide higher-level interfaces for developers. An entry at the Mozilla standards blog points out that such libraries could serve the same function for 3D [...]

  5. James Boston Says:

    There’s already work being done to make a javascript library to take advantage of canvas3d. You can download the library here:
    http://www.c3dl.org

Leave a Reply