Does someone know why this runs so slow?

Software: Away3D 4.x

patmat, Newbie
Posted: 25 October 2011 09:42 PM   Total Posts: 8

This seems like it could run a lot faster.

http://patrickmatte.com/stuff/brightness/

Here’s the code, very simple straight forward stuff.

http://patrickmatte.com/stuff/brightness/PictureLight.as

   

Avatar
Jerome Maurey-Delaunay, Moderator
Posted: 25 October 2011 10:37 PM   Total Posts: 17   [ # 1 ]

Hi Patrick,

Stage3D is no optimized to handle a lot of individual meshes & materials, like a bunch of planes. The best would be to try and merge the individual planes into one mesh before pushing it to render.

Look at the Merge class and the applyToContainer method.

Also, you should be able to use one material and offset the UVs on each plane. I know that was possible in 3.x, but I haven’t tested it in 4.x. Maybe someone from the dev team can comment on that!

Cheers,

J.

   

patmat, Newbie
Posted: 25 October 2011 11:03 PM   Total Posts: 8   [ # 2 ]

Thanks Jerome, I’ll look into merging the planes in one mesh.

   

Zerone, Newbie
Posted: 26 October 2011 01:21 AM   Total Posts: 22   [ # 3 ]

Because the material issue.
I have same problem, but I found a way:
http://away3d.com/forum/viewthread/1159/

   

patmat, Newbie
Posted: 27 October 2011 10:29 PM   Total Posts: 8   [ # 4 ]

Ok so I’ve put all the planes in a single mesh and it runs super fast. But when I try to move the vertices from the subGeometry, it becomes slow again. Is there a faster way to move the vertices?

Take a look at this.
http://patrickmatte.com/stuff/brightness/PlaneMeshTest.html

I also noticed it runs fast in Chrome but very poorly in Firefox and Safari. Anyone knows the reason for that?

Here’s roughly what I’m doing.

var vertices:Vector.<Number> = subGeometry.vertexData;
for (var 
i:int 0quads.lengthi++) {
 
var quad:Quad quads[i];
 
quad.animate();
 for (var 
j:int 0quad.vertices.lengthj++) {
  vertices[quad
.vertices[j]] quad.z;
 
}
}
subGeometry
.updateVertexData(vertices); 
   

Zerone, Newbie
Posted: 28 October 2011 03:57 AM   Total Posts: 22   [ # 5 ]

I think because the image you using the size is not the power of 2 size, which will be 2, 4, 8, 16, 32, 64 .... 2048

your wmode option is GPU, try DIRECT

but you example is very fast in Mac

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X