It’s a great time to be coding 3D – and a great time to be destroying your workday playing with 3D – thanks to free and open resources for OpenGL, now even in the browser.

If lovers of 3D dreamt up a standard for getting hardware-accelerated 3D in a browser, they’d have a tough time topping WebGL. It’s cross-platform and truly (cough, H.264 video) royalty-free – not just for some people under some circumstances, but for everybody, all the time. With similar code to the OpenGL ES 2.0 API, porting to mobile (where it fits in your hand) or native/desktop (where you can squeeze more performance and take advantage of multiple monitors) remains easy.

And now, while much of the future of the Web remains in draft form and is coming “real soon now,” WebGL is in a proper, 1.0 release. Apple, Google, Mozilla, and Opera are all working group members and are contributing side by side to making WebGL improve in their excellent browsers. (Give it up for Safari, Chrome, WebKit, Firefox, and Opera, folks.) Mobile WebGL is a bit more distant, but on desktop hardware, you can take advantage of this right now, today. Firefox 4.0 is nearing its final release; in the meantime, Google Chrome is a pretty easy way to go if you want to play with this quickly in a stable, shipping browser.

You can read about the WebGL 1.0 release in the press release from last week:
Khronos Releases Final WebGL 1.0 Specification

Royalty-free specification brings OpenGL ES 2.0 3D graphics functionality to HTML5; Adopted by Apple, Google, Mozilla and Opera with implementations shipping today; Free conformance tests available from Khronos; Call for Participation in WebCL Initiative

But play? You said you want to play with something and make eye candy for the rest of the day?

Glad you asked.

Tom Beddard’s Fractal Lab is a potent fractal toolkit for modern browsers, all built in WebGL.
http://fractal.io/

Creative Applications have a nice write-up:
Fractal Lab [WebApp]

Creator Beddard, aka subblue, has some other nice work up, featured in videos below. Read his write-up of the techniques, relevant to the WebGL version, too.

When you’re done playing and ready to make some eye candy of your own – browser or otherwise – the Khronos folks have got you covered.

So let’s get developing! (and some caveats)

OpenGL Overview

Khronos have posted loads of developer presentations online. It’s like a trip to San Francisco for the Game Developer Conference without the travel costs … or the parties and nerd-outs and free Motorola Xoom giveaways, sadly, but still.

There’s a lot of information about WebGL, but also OpenGL and OpenCL, among others. (And for now, for people doing live visuals and visual art, I think the non-browser versions remain the preferred way to go.)

Check out:
Developer Presentations Library

Specifically, if you’re into WebGL, see that track from Khronos’ presentations at GDC:
2011 GDC WebGL

Or, for good, old-fashioned OpenGL – including the new-fangled OpenGL 4:
2011 GDC OpenGL … and even OpenCL and mobile

What about those caveats? Well, you do need a very modern browser to do this – for Safari, that means a nightly, so the more practical option will be a Firefox beta or Chrome stable. Firefox 4.0 goes stable any day now, but that means we’ll have to see when a version of Safari is out that does this as a stable build; my bet would be on Lion, but we’ll see.

Okay, so the big “caveat” here is – surprise – Microsoft. Microsoft is committed to their own, Windows-only DirectX. See coverage of just that issue last week:
WebGL 1.0 spec finalized, everyone but Microsoft supports it [Download Squad]

WebGL 1.0 is done. Where’s Microsoft? [CNET Business Tech]

Since we are talking about hardware acceleration, though, it’s not just a fresh browser that’s a prerequisite. New OS updates and drivers are essential, too, as noted by the Google developers on The Chromium Blog, succinctly encapsulated in the title of their post:
GPU acceleration + old drivers = :(

Their advice:

1. Use the latest major version of your operating system (such as Windows 7 or Mac OS 10.6)
2. Install all system updates and driver updates that are available for your system.

But let’s get back to the point: we’re seeing impressive performance in browsers, support (aside from Microsoft) is coming quickly, it’s a final standard and not just a “draft” or something off in the future, and it’s hardware-accelerated 3D in a browser. There’s no new language to learn, no plug-in to install, no vague promises about how great things will be in the future. This is right now, here, today – and it shows the power of OpenGL and standards not only in the browser but across computing experiences from handheld to high-end desktop.

If that’s not reason to celebrate, I don’t know what is. So, give your eyes a treat…

More subblue eye candy…

subblue makes great music, too. Music and motion … who woulda thought?

  • Juno

    It is an interesting development, but the caveats are big ones. It's not only that MS are not very interested, but Flash 11 will include similar 3D elements and Adobe are going to slam market it.

    When VRML first arrived I was hoping for big things – I bought tools such Plasma, which was the 3DMAX variant specific to VRML design. But in time the competing tools and technologies meant that it never quite reached a share that survived. Of course the other thing about VRML way back when was that no one could find a really compelling reason for it. Only so many virtual galleries that people could make.

    OpenGL has to make a couple of convincing arguments or it's going to meet the same fate – great stuff but pretty niche.

  • mr knock

    I think the development of the 3D Capabilities in the new Flash Player is really interesting regarding live visuals. I hope apps like Resolume support it too.

  • 639me

    my new 17'' MBP doesn't tackle switching GPU on this. not the fireflies site either. reaches about 90° before total UI freeze, not even possible to switch or force quit apps. do you think this is chrome (10.0.648.151) or MBP relared?

  • Peter Kirn

    Oh, crap, I hadn't thought of that – I'm on a switching MBP, too, and the errors are consistent with what the non-discrete graphics system does. So you may need to force the GPU on — or Chrome may have to get smarter about its support of switchable graphics! (I'm guessing the latter.)

  • 639me

    discrete does the trick! strange though, since it was already on discrete (auto). somehow chrome switches back or something. 

    seems consistent also with a bug that makes apps like spotify, reeder and cloudapp (menu bar plug!) switch to discrete!