Away3D performance tips?

Software: Away3D 4.x

Boyan, Newbie
Posted: 29 August 2013 11:05 AM   Total Posts: 18

Hello,

I noticed that my Away3D application has significantly lower performance(fps) comparing to other Away3D applications which in the same time have more polygons to render(comparing away stats data). I wonder why.

My scene has no shadow methods applied, nor other resource consuming methods. Just geometry, textures and a lightpicker consisting of two lights, applied to every material in the scene. The scene contains many objects, but it is about 80k poly, which number I consider not high. The only thing which I assume is possible to slow down the performance are the materials with alpha channel applied to many objects(forest). But removing these objects improved performance just by little. Also I tried removing of all normal and specular maps but there was no change in performance.

Last but not least, are there any compiler settings for example(I use Flash Develop and Flash Builder), which should be defined for best performance? Of course I have in mind the release version, not debug one.


Thank you

   

Avatar
SharpEdge, Member
Posted: 29 August 2013 11:22 AM   Total Posts: 94   [ # 1 ]

My 2 cents: General rule in CG is to try to keep low the number of objects in the scene to reduce draw calls (few objects that contains many polygons rather than many little objects), so carefully design the groups of objects.
I don’t know how away3d works under the hood but i think this rule it’s valid also here.

The other suggestion i could give is, if you don’t find the cause, to profile your application to discover what is taking so much time.

   

ActionFrob, Newbie
Posted: 29 August 2013 11:24 AM   Total Posts: 10   [ # 2 ]

Hi,

I got a performance boost, when I used clone() and tried not to use “new” for geometry to often. For example use one global material for objects that need the same material.
Perhaps you should look up some culling methods in conjunction with octree?

Hope this helps!

ActionFrob

   

Boyan, Newbie
Posted: 30 August 2013 07:24 AM   Total Posts: 18   [ # 3 ]

Thank you guys.

I’ll have in mind your advises. But for this particular case I found what was the problem. The discovery was followed by a cry “How stupid am I”...
Actually I removed all the reflections from materials, but I forgot to remove the rendering of the reflections in the frame loop…

Thanks once more.

   

Avatar
alihm, Jr. Member
Posted: 01 September 2013 01:11 PM   Total Posts: 49   [ # 4 ]

Try to share materials and geometries for duplicate objects. also as SharpEdge said try to merge meshes to reduce draw calls (this has big effect). lot’s of transparent or blended materials also decrease performance because away3d sorts them in cpu.
You can also use Scout to see where the problem is, it’s a very helpful profiling tool.

   

Boyan, Newbie
Posted: 02 September 2013 06:50 AM   Total Posts: 18   [ # 5 ]

Well, I do use only one material on objects where materials should be identical. I put new materials in array and compare current mesh.material.name with those in the array. If there is a match the material from array is assigned to current mesh.

But it seems that the problem is somewhere else… I thought it was solved, but I realized that was wrong when tested the app on a less powerful machine.  On a testing computer with the minimal hardware requirements my application runs terribly slow at 1 fps on DirectX. At the same time an Away3D game from Away3D portfolio(the Moscow racing game) runs with nearly 60 fps while away stats window points more polygons than my app.

And that’s not all - when compiled in FlashDevelop the app runs fine on my computer with a decent frame rate of 60. But when the same code(with the same 3D scene) is compiled in FlashBuilder the app fps falls down to about 25-30… Have to mention that both IDE’s use AIR 3.7 SDK and target flash player 11.7. In Flash Builder I also targeted flash player 11.8 with the same poor result…


Any ideas…?

   

Avatar
SharpEdge, Member
Posted: 02 September 2013 09:43 AM   Total Posts: 94   [ # 6 ]

As we said you should profile your application with Adobe Scout or just the integrated profiler of Flash Builder, you’ll see the time each function call takes and find what’s slowing down your application.

Another options is try to start with the most basic scene with basic materials and adds up each time one feature and see when the render slow down.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X