Hi all,

Can anyone advise a performance friendly way to have 500+ Sprite3Ds on
screen?

I'm adding about 500 Sprite3Ds to my scene to create a cool grass
effect - it looks fine, but the performance drops down to about 30fps
from 60fps when all the sprites are on the screen. If I point the
camera away from the grass, the frame rate jumps back up to 60fps.
(and btw, I'm using wmode=direct)

Seems odd that Molehill is able to render complex geometry and 3D
animations, but struggles with sprites - I'm probably doing something
wrong, so I wanted to check if this approach is correct:

First, I embed a 30Kb, 256x256 png in my class and call it
"MyEmbeddedBmpClass", then basically just run this code about 500
times:
~~~
var sprite : BitmapData = new MyEmbeddedBmpClass();

var bmpMat:BitmapMaterial = new BitmapMaterial(sprite);
bmpMat.transparent = true;

var sprite3D:Sprite3D = new Sprite3D(bmpMat, 15, 15);
sprite3D.position = new Vector3D(100*Math.random(), 100*Math.random(),
100*Math.random());
addChild(sprite3D);
~~~

Of course, the loop could be more optimised by removing the var
delarations, etc but that's not the issue - my problem is a consistent
runtime issue, not just a code startup issue.

Can anyone advise a more performance friendly way to have 500+
Sprite3Ds on screen?

Thanks in advance,
Jahiro

Reply via email to