Flash 10 speed tests
by Rob Bateman
Sometimes coming from only one side of a problem restricts your view on the best way to evolve. In recent experiments with the latest Flash10 player, we have been testing how starting from a native cs4 approach fares when constructing a 3d framework, and have discovered a few interesting facts about Flash 10's renderer. Some of these nuggets include the following:
- DisplayObject sorting is a much faster option than triangle sorting.
- Fixed length Vector data stores are faster than linked lists when it comes to manipulating large data sets.
- Sorting using index references is much faster (and easier) than ordering screenvertex vectors
- ...


COMMENTS
jkozniewski said:
Hi,
Look promising
Colud you explain though why Away 3D FP10 branch is so much slower
compared to PV3D which make no use of new drawing API ?
I experienced big drop in performance im my own project when using Away3D ( no offence guys, just facts ) and it's also well tested here - http://clockmaker.jp/blog-en/2009/05/away3d_vs_pv3d/.
I suspect that it's connetced with perspecitve correct bitmap distortion
which is actualy slower than affine transformations even if it looks pretier and helps to lower
number of polygons on flat surfaces.
Am I right ? Don't you think that it woluld be desirable feature to have an opt-out from perspetive corrected drawing
to pre FP10 way ? Then one could optimize the scene better - apply perspective correction to floor and walls but
use faster afine transforms for objets/surfaces that don't really need perfectly accurate texture rendering ?
Thumbs up for the great work !
Exey said:
18 FPS on 50160 Faces with ZSort = false
AMD Athlon 64 X2 Dual 2.71Ghz, 2GB RAM
Rob Bateman said:
@jkozniewski
the speed tests on the clockmaker blog are a little biased, because the flash10 drawtriangles in it's basic form actually slows down the rendering process. If you were to compare the flash10 branch of papervision with the flash10 branch of Away3d, you would see a much closer speed comparison.
The above demo illustrates where we are coming from with the next major flash10 update. Keeping current features in Away3d means that ultimately we can't hit 20,000 tris at 30fps, but we are testing (with some success!) the possiblity of turning off features like interactivity and sorting in order to allow maximum speed for those that require nothing else.
jkozniewski said:
@Rob Bateman
I was just a bit ( unplesantly ) supprised that FP10 branch is actually slower than
Ok I understand
older ( FP9 ) engines and your explanation seems to confirm my suspicion that new features
like drawTriangles with UVT are not always the fastest way to render vast number of polygons.
I just wonder what's "not basic" form of drawTriangles that could outperform old ways of drawing ?
Whats more... colud please comment on idea of flexible renderer that could mix new and old
way of drawing ( since it seems that in some cases the old, I mean affine transforms here, way is faster and sufficient in terms of apperance ).
Rob Bateman said:
@jkozniewski
Well, drawTriangles can be pretty fast as you can see from the above demo, if used correctly. The reason why this is not currently the case in the flash10 branch of both Away3d & Papervision, is that the old render techniques separated each triangle draw routine into it's own method call. drawTriangles works best when a whole bunch of triangle data is rendered at once, and this requires some fairly hefty re-writing of internal data structures as you can imagine. However, we expect to be looking at the options very soon, and will of course update everyone with progress when we have more.
DonPaolo said:
20 FPS on 50160 Faces | ZSort = false
AMD Phenom II X4 940 | 3 GB RAM
makc said:
@Rob, in other words, you are not going to keep affine rendering in any way, right? I heared older tests found no significant difference between series of drawTriangles calls and single call performance, has this changed now?
makc said:
oh yeah, the results,
in high quality, 6840 faces run at 23(31) fps with zsort on(off)
in low quality, 53200 faces run at 3(4) fps with zsort on(off)
(feel compelled to point out that sandy was sorting in groups since forever, whoever came up with that idea - Thomas? - is a smart guy)
zszen said:
mesh:100
face:76000
z-sort:false
fps:12-18
mem:56mb
z-sort:true
fps:5-18
mem:61mb
Great!!
Jesse Nicholson said:
Honestly I've been digging around looking into all of the flash 3D engines and to me away 3D looks the best, might arguably not perform the best RIGHT now but I think is the most promising. I've messed around with papervision and at that time didn't like my scenes freezing every 5-10 seconds getting choked up refreshing.... don't know how much better it is now but..
Anyway with 28880 faces amd X2 64 (on 32 bit plat) 3 gigs ddr2-800 getting about 20 fps avg.
Dominik said:
Hi,
first id like to point that the FLASH 10 SPEED TEST is most likely to be biased. If u analyse carefully this demo you will see that u add more triangles but u can also see that those triangles are smaller as you add them. So u add more triangle but they are each time smaller so its not necesseraly more pixel drawn on screen.
peace
Bruno said:
How can I improve this?
I was thinking of switching an application from PV3D to Away3D thinking that performance would increase and, the following test just got me concerned about it. In PV3D I was able to have many more cubes with many different textures of about the same size and performance was significantly better in PV3D. Also, I've noticed that the Renderer.CORRECT_Z_ORDER option will kill the frame rate significantly, even when no objects are intersecting.
I'm using Away3D 3.6.0 (FP10) and latest AIR 2.5 to run it (I'm on an AMD Athlon 64 X2 Dual 2.71Ghz, 2GB RAM).
<![CDATA[
import away3d.core.base.Object3D;
import away3d.tools.utils.Drag3D;
import away3d.core.base.Vertex;
import away3d.events.MouseEvent3D;
import away3d.debug.AwayStats;
import away3d.containers.*;
import away3d.core.math.*;
import away3d.core.render.Renderer;
import away3d.core.utils.Cast;
import away3d.materials.*;
import away3d.primitives.*;
import flash.display.Bitmap;
import mx.core.UIComponent;
[Embed (source="marlboro-classics.jpg")] // Small image of 80x180 pixels
private var marlboroClass:Class;
private var marlboroBitmap:Bitmap = new marlboroClass();
public var view:View3D;
private var drag3d:Drag3D;
private var cube:Cube
private var holderUI:UIComponent = new UIComponent();
public function onCreationComplete() : void
{
this.maximize();
this.addEventListener(Event.ADDED_TO_STAGE, init3D);
this.addChild(holderUI);
}
public function init3D(event:Event) : void
{
this.view = new View3D({x:800, y:600});
//this.view.renderer = Renderer.CORRECT_Z_ORDER; // This really, really slows things down (50 cubes and FPS was down to 0 if all cubes are in same position???
holderUI.addChild(view);
// Add Draggable Cube
var marlboroMaterial:BitmapMaterial = new BitmapMaterial(Cast.bitmap(marlboroBitmap));
for (var xx:int = 0; xx < 20; xx++)
{
for (var yy:int = 0; yy
-----