Amazing: Playstation-quality 3D in Flash!
Heads up, everyone: 3D is about to explode on the Flash Platform in a big way!
There are only a handful of times I remember feeling as excited about a development on the Flash platform as I do right now. The first was the introduction of C-style syntax in Flash 5 so I could kiss slash syntax goodbye. The second was seeing Flex for the first time. Other times include when the bitmap features in Flash 8 were introduced, seeing alpha channel video in Flash, my first test on the new AVM, seeing OSFlash and Red5 blossom, and the release of ActionScript 3, Flex 2 and Flex Builder 2. Today, I feel like we've reached another tipping point in Flash: It's finally time for 3D.
When I first saw alpha channel video in Flash, I stated that it would "change the aesthetics of the web". I believe this has largely come about: We now have a an unprecedented level of integration between video and other interactive rich content on the web thanks to pioneering Flash-based web sites and applications. The video in such sites isn't a separate item that you hassle over ("Do I have this codec or that? Which player do I select? Was the pop-up blocked?"); it blends in to become a transparent (no pun intended!) part of the experience. We're about to see a similar fundamental leap in the aesthetics of the web with a technology that allows 3D to become a similarly transparent part of the web experience thanks to an open-source project called PaperVision3D.
Papervision3D (also see PaperVision.org) is a high-performance 3D engine for Flash 8 and Flash 9. It was started and is led by Carlos Ulloa and the process of open sourcing it began around the end of October, last year. Once open-sourced, development proceeded in leaps and bounds with the input of my good friend John Grden (who, I'm convinced, has at least three clones to be as productive as he is on so many amazing projects), Ralph Hauwert and a dedicated team of other developers who not only contributed to the AS2 version but also made the AS3 version possible. And it's that version that I'm most excited about. Why? Because, finally, after years of being crap for 3D due to the speed of the Flash virtual machine, we now have a virtual machine that is fast enough to do real-time 3D (and I don't mean spinning a solitary wireframe cube.) Just take a look at the 3D Star Wars demo by John Grden that was shown at MacWorld last month (click the rectangular icon at the bottom-right to see it full-screen!)
With Papervision3D, we basically have the level of processing that the original Playstation had, along with the same sort of limitations (e.g., you see some issues in the Star Wars demo due to the z-averaging being used and you'll need the same sort of workarounds in modelling/texturing to get around them.)
Playstation-level 3D in Flash today: That's just amazing!
To put this into context: Here's a link to cutting edge 3D work using the Canvas tag (turn the textures on to High to a get good idea of the performance). Compare that to the demo at the head of this post. It's one of two amazing demos that Ralph Hauwert just released, showing real-time bump mapping in Flash for the first time. That's real-time bump mapping, in Flash!
It's true that people have attempted 3D in Flash to various degrees of success in the past, such as the excellent Sandy project on OSFlash -- another open source 3D engine -- but this is the first time I've seen such momentum on a project that actually makes it easy to create 3D in Flash. (Goodness knows there's also a demo scene that's doing some crazy stuff with 3D and Flash right now!)
Papervision3D supports the Sony-sponsored Collada standard which is supported by 3D Studio Max, Maya, and Blender (open source), as well as a growing number of other tools. Collada is actually the native format for Google Earth (see Flash Earth for another amazing project by Paul Neave) and is supported by Google Sketchup (you can find a Collada .dae file inside a Google Sketchup .kml file if you rename it to .zip and unzip it.). Papervision3D also supports the ASE format that 3DS, Cinema 4D and other tools can export to. Loading in a Collada file and having it parsed basically takes a single line of code. Add a few more lines to load in and add your textures and render it and you have a real-time, texture-mapped scene in Flash.
What's really exciting is seeing how some of the open source projects in the Flash world are coming together: For example, there's something in the works called PaperWorld that is going to blow your socks off (again, Keith!) What do you get when you combine Red5 and Papervision3D? Hmm...
So, what's next for Papervision3d? Well, now that we have bump mapping support, Ralph is reportedly working on getting normal mapping implemented.
And, finally, in local news: If you're attending BarCampLondon2 tomorrow, you're in luck. Carlos Ulloa is going to be there and he will be demonstrating Papervision3D. I'm really glad that Carlos managed to get in with the last round of released tickets as otherwise I was going to attempt to present it and it wouldn't have been half as interesting as getting it from the horse's mouth. (Where did that expression come from, really?) I'm personally really looking forward to meeting Carlos in person as I was kicking myself for having to miss the London Flash Platform User Group meeting that Carlos presented at last month as I was in Singapore.
There are links to other demonstrations of Papervision3D on the Papervision3D blog and here are some other useful links to get you started: