iPad low performance (100 colored cubes = 11 fps)

Software: Away3D 4.x

xelanoimis, Newbie
Posted: 19 May 2013 09:40 AM   Total Posts: 3

Hello,

I was planning to use Away3D for iPad games but I’ve got low performance on a simple test I made, so I was wondering if I’m doing something wrong and where is this performance issue comming from.

I have a scene with 100 simple cube meshes with color material and this produces a 11-15 fps rate on my iPad2 (iOS 4.3.3 jailbreaked). Here is my code and I have attached screenshots too.

package {  
 import flash
.display.Sprite;  
 
import flash.display.StageAlign;
 
import flash.display.StageScaleMode;
 
import flash.events.Event;  
 
import flash.geom.Vector3D;
  
 
import away3d.cameras.*;  
 
import away3d.containers.View3D;  
 
import away3d.entities.Mesh;
 
import away3d.materials.ColorMaterial;
 
import away3d.primitives.CubeGeometry;
 
import away3d.controllers.HoverController;
 
import away3d.debug.AwayStats;
 
 
[SWF(width=768height=1024frameRate=60)]
  
 
public class Main extends Sprite  
 {  
  
private var m_view View3D;  
  private var 
m_hc HoverController;
    
  public function 
Main()  
  
{  
   stage
.scaleMode StageScaleMode.NO_SCALE;
   
stage.align StageAlign.TOP_LEFT;

   
m_view = new View3D();
   
m_view.backgroundColor 0xff303030;
   
addChild(m_view);
   
addChild(new AwayStats(m_view));
 
   
// create 10x10 colored cubes
   
for (var = -5050y+=10)
   
{
    
for (var = -5050x+=10)
    
{
     
var r:int = (x+50)*2;
     var 
g:int = (y+50)*2;
     var 
b:int 0;
     var 
color int 0xff000000 | (<< 16) | (<< 8) | b;
     var 
cube Mesh = new Mesh(new CubeGeometry(999), new ColorMaterial(color));      cube.positi Vector3D(x0y);
     
m_view.scene.addChild(cube);
    
}
   }
   
   m_hc 
= new HoverController(m_view.cameranull15010200);

            
this.addEventListener(Event.ENTER_FRAMEUpdate);  
  
}  

  
private function Update(e:Event):void 
  {  
   
if (m_hc)
   
{
    m_hc
.panAngle mouseX 768/2;
    
m_hc.tiltAngle mouseY 1024 2;
   
}

   m_view
.render();                    
  
}  
 }  

If I use the same geometry and the same material for all cubes I get about 15 fps. I also observed low performance in other situations related to simple action script code from which I would expected no impact on fps.

The PC build has a steady fps (58-59) and my PC isn’t top class (an old DualCore).

I also wonder why on the iPad the memory graphic (pink) goes in stairs (maybe the garbage collector at work) because on PC it is steady.

The alternative is to continue porting my own engine (C++) but I don’t know much of this performance issue are limitation of iPad, how much of the ActionScript and how much of Away3D engine.

Please help me with some advice.
Alex

 

   

Avatar
vorodis2, Newbie
Posted: 19 May 2013 09:15 PM   Total Posts: 22   [ # 1 ]

Try it.
1. Remove the debugger. It uses vector and cell phones do not like him.
2. Apply one materyal, look for information about the textural atlosy. Mobile applications should be one materyal with a single texture.

   

sargon, Member
Posted: 20 May 2013 11:53 AM   Total Posts: 51   [ # 2 ]

Sory for not helpfull post but It is not imposible that you get so week performance…

First of all are you compile debug or run build? (debug build can slow down perf)

And ! Fb has an option while building ios app that tells to build standard or fast way. when you chose fast option the performance is very week but build is done quickly, if you chose standard option the build takes more time but the performance is sweet smile check it (Run configuration->Lunch configuration ) in mobile application run method.

If nothing help just try to use Adobe Scout to determine which part of code cost you the most time.

no more ideas at the moment.

Regars!

   

xelanoimis, Newbie
Posted: 21 May 2013 03:29 PM   Total Posts: 3   [ # 3 ]

Thanks for the suggestions!

The build mode was responsible. I was using F5 which produces a quick debug build executed by an interpreter (I’m using FlashDevelop).

If I execute the PackageApp.bat I get more options:

[4] fast test (ipa-test-interpreter)
[5] fast debug (ipa-debug-interpreter)
[6] slow test (ipa-test)
[7] slow debug (ipa-debug)
[8] “ad-hoc” (ipa-ad-hoc)
[9] App Store (ipa-app-store)

Choosing [6] the build takes quite some time, but it produces machine code for iPad. The whole thing runs now as it should, at 58-60fps.

Not sure about the difference from [8] “ad-hoc” but this option asks me for a password which strangely I can not enter (using fake certificate for now anyway).

So after all, 100 colored cubes didn’t kill the iPad smile

Alex

   

sargon, Member
Posted: 21 May 2013 08:13 PM   Total Posts: 51   [ # 4 ]

I am Glad that my suggestion helped in some way smile

I never used flash develop before and do not know those build options I only know those from flash builder

Best regards

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X