Wish granted!

Think 3D in the browser will never catch on? Think again. The folks at Google Labs have built an incredible-looking 3D API called O3D. It does just about everything you want, and then some:

  • It’s multi-platform: Mac + Windows + Linux.
  • It can render to both OpenGL and DirectX render pipelines.
  • You can write your own vertex and pixel shaders. You have to use O3D’s own language for doing this, but that actually enhances compatibility, as frustrated shader coders may already know. (See the FAQ)
  • It’s a scene graph, so managing complex 3D scenes isn’t a chore.
  • It has powerful built-in functions like viewports and pickers (plus custom pickers), so you can actually get something up and running in a reasonable time.
  • It has an import workflow with COLLADA, an open standard for 3D assets (and which, incidentally, has support in Google’s own SketchUp).
  • You code in JavaScript, using the powerful V8 engine (developed for Chrome).
  • Gears lets you run offline.

There are already some complaints about “another standard,” but to me, putting together a whole package here and employing other, lower-level standards (JavaScript, COLLADA, OpenGL, DirectX) makes a lot of sense.

http://code.google.com/apis/o3d/

I expect the folks working on Java and JavaFX are busy thinking about the fact that Sun just got bought by Oracle – something I’m hopeful, at least, ensures Sun’s future and is ultimately a good thing. But I hope someone on those teams is starting to get the message: 3D isn’t just something that’d be “nice to have.” It’s essential. And while even most developers likely don’t have a clue about things like custom shaders, having access to customize the graphics pipeline is likewise something ultimately benefits all developers – even if they just wind up relying on someone else’s code. I really do hope this is a priority with the coming development of Java and JavaFX, which could have the power to do these sorts of things. (Heck, Java could even benefit from the code Google just posted.)

On the proprietary side, this to me is a big blow to Microsoft’s WPF and Silverlight and Adobe’s Director. Unlike those products, O3D looks simple, powerful, flexible, open source, and directly programmable with JavaScript.

That’s not to say there aren’t some questions here – and the Java/JavaFX comparison is especially relevant:

  • Another plug-in: You do have to install a plug-in to work with O3D, something that actually isn’t necessary with JavaFX (when it finally does 3D) or right now with JOGL and Java3D.
  • Mobile, or just desktop? My big question I have is what this means for mobile. I’d love to have O3D work with OpenGL ES on, say, Google’s own Android platform.
  • Not Just JavaScript? It would be nice if eventually you could use other languages like Java to program O3D.
  • Sound? Oh, yeah, that. 3D sound is an ideal complement to this sort of scene, and the browser may be a bit constrained in that respect. I’m curious whether O3D might eventually include an audio API. (And yes, that’s where something like Director is still unparalleled.)
  • Making it actually work: Okay, there’s also the fact that I haven’t successfully installed it just yet. Working on that.

(I’ll try to get answers to those questions.)

Oh yeah, and then there are details like the necessity to write your own custom shaders just to add more than one light to a scene – I think this will initially appeal only to folks with some real 3D experience.

But am I excited? Ohhhhh, yes, indeed. O3D itself looks fantastic, and I think this is a sign that 3D times ahead are going to be really fantastic.

And as long as you have the plug-in working and a browser in full-screen mode, you could literally set up an O3D project as a performance / installation tool. O3D visualists? Absolutely. Enjoy.

  • http://tekkind.com Neb

    That is intense. All those years of game and map design are starting to making sense…

  • http://www.nwav.org Tim Reha

    Reminds me of back in 1996 at InternMedia World in S.F. hanging out with the VRML guys…

    I guess it takes 13 years for things to move in the web 3D worlds space.

    Thanks for the post Peter!

    Tim R. – Seattle

  • http://createdigitalmusic.com Peter Kirn

    Yeah, and think about how much better of we are than we were 13 years ago. Our mobile devices now easily outpace what was the best-available desktop graphics. Every OS now composites the desktop as 3D, at least as an option (by default in Aero on Vista, optionally in Linux, exclusively on Mac).

    Of course, the sophistication translates to a steeper learning curve — VRML was a heck of a lot simpler, whereas now you really do need to program the whole thing. But the payoff could be worth it.

  • http://tekkind.com Neb

    I remember back around that time a toolset and environment for building online 3d content (was it something Adobe?). I hope that this time around it has better success.

    Hopefully folks will take some cues from the gaming community (blizzard and ID for example) when considering accessible tools to efficiently design, animate, and script these experiences. Sketchup is certainly a good start.

    Javascript is nice, but it doesn't jive with the visually focused thinking that designers tend to be most comfortable with. Notice the patching systems in Blender, Shake, Maya, and QC. Systems design is fun, but I think commercial success is going to hinge on how well content can be made.

  • http://www.musicvisuals.com Rovastar

    This is a interesting development.

    We are looking to make a web based visual as part of our next project and is something we could consider. I was surprised it is not GLSL based and it is all in house so you will have to relearn new tricks but it could be a useful addition. There are going to be a lot of new ideas for 3d graphics APIs in browsers in the future I wonder if this one has the power under the hood to be acceptable.

  • yoo

    I hope there isn't a html style browser war with competing languages and technologies that end up creating massive headaches for users down the line…

  • Zachary Dixon

    Just think! this could spawn a whole new way of surfing the web! think online virtual shopping malls.. etc..

  • http://createdigitalmusic.com Peter Kirn

    @yoo: See, I think that's what's changed. The idea that you could describe an entire 3D world with just "markup" I think is actually dead. So there's not really even a competing concept here. The thing is, if you want to *do* anything with all that 3D awesomeness, you really need to write some actual code.

    The important thing is that you have standards for:
    * storing assets
    * rendering to the graphics card
    – and that:
    * you're cross-platform-compatible
    * you have sufficient control over the tooling and rendering to make it to what you want (i.e., the tooling needs to be flexible, and ideally open source)

    O3D and technologies like it are going to hit all those points. We've pretty much got the standard for the GPU down — it's OpenGL. Now, the one issue with O3D as folks are saying is that there isn't a common shader language. It's supposed to be GLSL, but in practice things aren't always compatible. I don't think it's such a big deal that Google is doing their own thing. For one thing, porting from one shader language to another is not a big problem if you know what you're doing (and if you're trying to work with shaders, odds are you do). It's not a whole lot of code, and most of this stuff works basically the same way. What Google is doing, effectively, is actually to compensate for incompatibilities at the GPU level — or so we hope, anyway. ;)

    No, I think the bigger deal is keeping this stuff open source and having a common asset format like COLLADA. (OBJ would have been nice, too, but…)

    I haven't tried it yet, but there is a COLLADA plug-in for Blender so you can keep your whole toolchain entirely open source: http://colladablender.illusoft.com/cms/content/bl

  • http://www.mutantquartz.com Steve Elbows

    I got the plugin working, performance is pretty impressive, really exposes 3D flash for the CPU hog that it is.

    There is also a firefox project to expose OpenGL ES 2.0 to javascript in the browser, it has similar potential to the google thing.

    I would anticipate that developers will build even higher level stuff on top of these, and thus open it up to those who cant develop on that level. For example Quartz Composer works in Safari browser rather nicely, but is obviously not cross-platform so hasnt really been utilised much. But it is possible to imagine that at some point in the future, people could build a cross-platform alternative that opens up 3D web authoring to a wider range of minds via intuitive tools.

    If Apple ever make a multitouch device that has full OSX and reasonable GPU, then I think we might see people developing webapps for it using Quartz Composer and this should show the potential and lead to more cross-platform alternatives and a lot of fun.

    Until that time arrives, I either have to stick with Quartz Composer and limit myself to the mac, or go for some relatively expensive tool like Unity 3D which has a fairly reasonable web plugin and good tools that a semi-programmer like me can actually harness.

  • grigori

    I used to like VRML… it was the future….:)

  • godprobe

    wow. nice.

    also, iirc, CSS has a semi-3D horizontal-positioning property for audio called "azimuth" — which of course most browsers don't support. perhaps when they do, that can be taken advantage of alongside this API.