06.02
[Update] Comments fixed now, sorry about that – moved to a new server.
I recently finished a 3D ‘metropolis’ in Papervision, and had a lot of fun doing so, although to be honest – I was rather disappointed with the performance. Given the time frame (just over three weeks) I’ve no doubt there’s room for improvement in my code, but I’d really hoped for more. I should be clear that I’m not criticising Papervision, or Flash – but developers need to be aware of the technologies limitations (I wasn’t) before signing off on a brief
. Still, if you’ve already made it that far, below is a list of the most significant performance boosts I used to get past the finish line;
StageQuality; I was horrified about the idea of reducing stage quality – but the truth is, reducing the stage quality whilst a 3D animation takes place is a big plus for the frame rate and hard to spot in terms of quality. Thanks to http://www.julapy.com/blog/ for that one.
Texture size; If you’re going to use movie clips as textures you should note that performance is directly proportional to the clip size. As with StageQuality reducing texture size whilst making a transition pumps up the frame rate without being noticeable. Another big plus of variable texture quality is the ability to zoom in on a 3D texture without it becoming pixelated. To vary the textures quality I added it to a parent container; this way Papervision can use the scaled width and height without messing up the UV mappings;
…
_textureClip.scaleX = _textureClip.scaleY = TEXTURE_QUALITY;
var bitmapMe : Sprite = new Sprite();
bitmapMe.addChild(_textureClip);
_movieMaterial = new MovieMaterial(bitmapMe, useAlpha, false, false, new Rectangle(0,0,512*TEXTURE_QUALITY,512*TEXTURE_QUALITY));
…
Animation; The performance hit generated when animating textures is the most significant of all settings – I didn’t use it freely on any of my textures. Instead I enabled animation if and only if the texture had update. The simplest example of this being button rollovers . By animating the texture when the button is rolled over, and disabling again once the movie clip animation is finished you get a big change in overall performance. To this end all of my 3D display objects extended a single class that would call (usually via a timer/enter frame as animations took place);
movieMaterial.drawBitmap();
In the end though I did have a lot of fun with Papervision, Blender and the rest - but next time I tackle something like this I’ll do so with these limitations in mind.




New blog post: Papervision – pushing the performance http://blog.ifuller1.info/?p=70
awesome work, especially with the timeline it sounds like you were against. how did you get the black ground texture to span the stage and still react as part of the pv3d scene?
Hi Jason,
The ground was a bit of a cheat really – it’s just a big flat ellipse facing towards the camera. The camera actually stays still with the buildings heading towards it, you can tell in some instances but mostly it does the trick.