Posts

Showing posts with the label 3d

Away3D 3.6 Essentials – Book Review

Ok, so here’s a book I definitely can recommend! ;-) Away3D 3.6 Essentials by Matthew Casperson (published by Packt) is a really great introduction to creating 3D content in Flash with the free and open source Away3D library.



For a brief time in the summer of 2008 I was the golden-boy of Flash 3D after my team at Bloc launched the Papervision-powered game/transmedia experiential play-node called Meta4orce, which I documented to launch my new blog. While my experience and high google ranking for the term “papervision developer” (#2 – boom!) earned me a couple more PV3D gigs, it all tailed off by the end of 2009. The fact that the Papervision3D team pretty-much abandoned development and moved on to new projects didn’t help, but there was also a sense that the novelty of 3D Flash content was wearing off (especially with such jaw-dropping competition as Unity3D’s island demo).

But 3D Flash content was not in fact dead, and the Away3D engine very ably filled the gap left by the demise of Papervision. I never kept up with developments in the Away3D world, so this book was a great re-introduction. So what I have I learned? Well one nice thing to see is that many of the techniques I had to manually create in my Papervision3D work are actually integrated into the Away3D engine itself. This includes things like:
  • level-of-detail (LOD) model-swapping, so that when objects are far away they use a simpler mesh.
  • flat sprites and multi-directional sprites like you see in Doom and Duke Nukem 3D.
  • splitting objects into individual layers and display objects, to solve triangle-sorting issues when a model sits on top of the ground.
  • skyboxes.
  • isometric camera.
  • depth of field effects using sequences of sprites at different levels of blur.
Matthew’s book gives a good explanation of the theory behind these techniques (and many more – the book is incredibly thorough and comprehensive), as well as how to apply them using Away3D. I also learned a bit of general 3D theory about things like UV mapping, triangle Z-sorting and effects like normal mapping and bump mapping. On the whole, though, this book is very much a practical manual of how to use each of Away3D’s features. If I have any criticism, it is that there’s not too much there that you couldn’t get through scouring the documentation and source code, and it doesn’t ever pulled together all the strands to make one amazing demo at the end. That’s up you to go off and do yourself I guess. One really nice addition is that this book does document Away3D’s bugs and offers work-arounds, which could well prevent you from pulling your hair out a few times.

Reading Away3D 3.6 Essentials has really re-opened my interest in Flash 3D, and I think I’m going to do a few experiments with Away3D in its current form, so that when the hardware accelerated magic of Stage3D and Away3D v4 hit Flash, I’m not playing catch-up.

Molehill + Scaleform = hardware accelerated 2D in Flash?

This post is pretty much an open letter to Adobe, so if you know anyone who works there, please send it to them. I've had what I think is quite an interesting idea, and I think it's one that Adobe should have a long think about. The Flash player is about to add hardware accelerated 3D rendering with "molehill". The demos that have been released so far look great - amazing 3D scenes rendered with no impact on the CPU. All the rendering is handled by the GPU, leaving the CPU free to process your game logic, including physics, collision detection and AI - which allows for more advanced gameplay (and stops Flash-haters fixating on how much of their precious CPU the "bloated" Flash plug-in is consuming).

However, this will only apply to 3D games. In fact 2D games - which we must not forget are what has made Flash the number 1 gaming platform on the web - will see no benefit from this release. What's the message from Adobe here? That 3D is the future of gaming - 2D is not important, or at least 2D games already have good enough performance. But when you consider that native 2D iPhone and Android games have similar (if not better) performance than 2D Flash games on much inferior hardware, you can see there is plainly massive room for improvement. Now look at the iPhone and Android appstores, where there is a genuine choice between 2D and 3D games. The charts are dominated by 2D games like Angry Birds, showing that 2D is still the dominant style for casual games.

Ok, so what can we as game developers do about it? Well, we could make all our 2D games using bitmaps rendered on 3D planes, and so leverage the GPU rendering of "molehill". Now our CPU is free for game logic. But what have we lost? Well for starters the display list with it's powerful nesting features, filters, textfields, use of the Flash pro IDE for layout. In short everything that makes Flash what it is.

So what can Adobe do about it? Well, there already exists a technology called Scaleform that renders the Flash vector engine using GPU accelerated 3D by tessellating 2D graphics - effectively turning them into flat meshes of 3D polygons that the GPU is designed to render fast. This technology is used to make 2D user interfaces for console and PC games. Now, I'm no expert in scaleform or graphics hardware, but it seems to me that this technology or something very like it could feasibly be integrated into the Flash player, meaning whole Flash scenes and timelines could be rendered largely on the GPU. This would keep the Flash pro IDE as a relevant product, and take Flash beyond being the most popular platform for 2D games, to being the best platform for 2D games.

In 2008, along with many other developers, I asked Adobe for joypad support in Flash. At MAX last year, Adobe finally announced their plan to add this feature. I'm just as certain that I'm right that Flash needs hardware accelerated 2D.

This video shows how much power the GPU brings to Flash - wouldn't it be awesome to have that much power in our 2D games? Comments / reasons why I'm barking up the wrong tree are greatly appreciated! :)

Unity3D for PC - I, for one, welcome our new 3D overlords!


I'd heard this from an "insider" a while back, but now it's official (thanks Ryan) - Unity3D development is coming to PC. 900% more developers should mean 900% more games, which will lead to client and user acceptance of the technology. For some of the work I do, at least, it will mean an end to worrying about poly-counts and clipping bugs, and more time to make cool games! Sweet.