Papervision 3D
We’re working on a new game called “Subterfuge”. It’s like Chess meets Stratego, with a sci-fi theme. The gameboard is a grid, with “buildings” which represent blocked squares. Originally it was 2D, with white squares to designate the buildings. However, I realized that it’d be cooler to to represent the gameboard in 3D, which would allow you to give a bit of parallax to the buildings. I could also do a nifty little fly-in! This all required finally getting around to examining something I’d wanted to check out for a while: Papervision 3D . It’s open-source, AS3, and reasonably mature.
The results: 3D in Flash is a clever hack. What Papervision does is essentially to use Flash’s geometry fill functions, add their own math libraries, projection and camera systems, some scene management, and then wrap it up with some object importation and material management. Sounds great! Unfortunately, due to the restrictions of Flash, it lacks a lot of the modern comforts of traditional DirectX hardware programming.
Such as — perspective texture mapping! It’s 1992 all over again! Large polygons have to be subdivided to avoid linear mapping artifacts. Oh, and there’s no z-buffer. Back to bounding-sphere sorting! And since there’s no z-buffer, you don’t get any z-testing or pixel early-out like most hardware cards today perform. Thus, overdraw matters, in a big way.
Nevertheless, what they’ve done is pretty neat. Depth of field can be faked using the Flash 9 blur shader. They’ve implemented bump mapping (!). All in all, a bit limited, and slow — but it has it’s uses. (Such as the grid in our game!)
Speaking of which, we’re just waiting on some art at the moment, and we hope to get a private beta out to sponsors next week. More news to come!
- andrew