Optimizing for AIR 3.2 for Android

Software: Away3D 4.x

Avatar
Fabrice Closier, Administrator
Posted: 19 March 2012 02:54 PM   Total Posts: 1265   [ # 16 ]

ah sorry, wrong name…
http://www.closier.nl/RoomDemoMobileCR.apk

 

   

Avatar
Baush, Sr. Member
Posted: 19 March 2012 03:25 PM   Total Posts: 135   [ # 17 ]

Runs nice and smooth smile I’ll try disabling any light effects in my scene and try again.

Thanks!

 

   

Avatar
Baush, Sr. Member
Posted: 20 March 2012 05:25 PM   Total Posts: 135   [ # 18 ]

I managed to get 20fps tops, but my scene is a bit more complex with height terrain, trees, water and some objects. Perhaps I need to optimize the game logic code a bit more, there may be something slowing it down..

Have you managed to get something complex running smoothly (other than viewing a 3d model viewer) with game logic, mouse interaction, etc?

Thanks a bunch!

 

   

3dNewb, Sr. Member
Posted: 20 March 2012 07:33 PM   Total Posts: 105   [ # 19 ]

I have a rather complex scene going on, trees, buildings, a plane flying around. I found that the actual bottleneck is not the amount of vertices or triangles, it is the amount of objects. So 600 very simple plane meshes gets you 8 FPS, but if you merge the geometry, you get a whopping 60 FPS.

So if you can, merge as many static objects as possible.

Also:
Do not smooth bitmap textures,
Do not use dynamic shadows

 

   

Avatar
Baush, Sr. Member
Posted: 20 March 2012 08:31 PM   Total Posts: 135   [ # 20 ]

thanks for the tips, I’ll give it a try

 

   

Phasor, Newbie
Posted: 04 April 2012 06:25 PM   Total Posts: 5   [ # 21 ]

Hi Fabrice,
I tried your room demo apk on my Samsung Galaxy S Plus and the framerate is about 20fps. Is that normal?. I think HTC desire is not superior to Galaxy S Plus (the same gpu i think, adreno 205).

Also, when you touch and move the camera, the response is a bit slow, like if the mouse/touch/tap/swipe controls where delayed.

In which devices did you get 60fps?

Thanks so much!

 

   

Avatar
Baush, Sr. Member
Posted: 04 April 2012 06:32 PM   Total Posts: 135   [ # 22 ]

Here’s my tests:

Google Nexus S: 35-45fps
Samsung Galaxy tab 10.1: 17-20 fps

 

   

Avatar
Fabrice Closier, Administrator
Posted: 05 April 2012 08:42 AM   Total Posts: 1265   [ # 23 ]

@Phasor
I get 60/60 on moto xoom, iPad and even on my 3yo IPhone 3gs (snapshot)
on HTC desire of my colleague it goes to 35-45 and high 50 on the newer HD.
Note that I did this demo quite a while ago, just to see if the new Prefab AS3 exports would make a diff even using a non mobile friendly model such as this one (too much geometry, too much maps). The same done the “classic” way, the app do not even passes the init handler and crashes on all devices tested with it.
In meanwhile, the latest improvements done on Prefab exports allow better performance…

 

   

Phasor, Newbie
Posted: 05 April 2012 09:09 AM   Total Posts: 5   [ # 24 ]

Thanks Fabrice,
I undestand that it is not optimized at all for mobile. What I dont understand is the performance difference between similar hardware…

 

   

Avatar
Fabrice Closier, Administrator
Posted: 05 April 2012 11:06 AM   Total Posts: 1265   [ # 25 ]

Same device with active apps/process in background would give you lower performance results. Memory, chip sets, disc space, busy cloud service etc…

You can choose to work with an average device per OS and make it run ok so that slightly lower performant ones could still handle the load. Or specifically target a device. Tho there too, there is not really solid rock ways to be sure it will run ok. Take for instance the new IPad and IPad2. You would expect the new one outperforms the old one… And these apps can be installed on gen 1 too.

To me it comes down to this: don’t focus too much on device, just ensure your content is optimized as hell first. Then start test on most widely spreaded devices. If you do not have access/own other devices, spread your content to friends so they could test for you. With Android it’s super easy to do so, for IOS there are solutions such as testflightapp.com to let others put your test apps on their devices.

 

   

Avatar
Baush, Sr. Member
Posted: 05 April 2012 11:47 AM   Total Posts: 135   [ # 26 ]

Fabrice, could you package a captive runtime of your demo (if not already) to make sure performance is not dependent on the installed Air version on the device?

Thanks!

 

   

Avatar
Fabrice Closier, Administrator
Posted: 05 April 2012 12:48 PM   Total Posts: 1265   [ # 27 ]

the “CR” in my url stands for captive runtime…
It was something like air 3.2 beta #3, non public at that time.
I’ll reexport it to latest sdk, to see if there are diffs.

 

   

Avatar
Baush, Sr. Member
Posted: 05 April 2012 12:55 PM   Total Posts: 135   [ # 28 ]

Thanks Fabrice.

Closing all running apps improved the fps by about 4-5fps.

I’ve seen some native 3d games on android with options to lower the resolution of the rendered area (and stretch/scale to full screen) to improve performance.

Are you aware of any air descriptor / api options that could achieve the same result? as the 3d rendering is done as a backdrop, I assume playing with the scale attribute of the view wouldn’t affect anything.

Thanks!

 

   

Avatar
Fabrice Closier, Administrator
Posted: 05 April 2012 01:58 PM   Total Posts: 1265   [ # 29 ]

Not a descriptor option as far as I know for that. You should be able to do this using as3 without problems.

Closing all running apps improved the fps by about 4-5fps.
see, and what if some are also 3d apps…
Android will close them eventually in case of greater perf losses, but if you loose just 4 to 5 fps, it will try hard to maintain all the apps for your comfort as a user.
On IOs specific capabilities you can define a “real” quit on app close, I don’t know the equivalent tag for android descriptor.

 

   

Phasor, Newbie
Posted: 05 April 2012 07:13 PM   Total Posts: 5   [ # 30 ]

Maybe will be a good idea to package a version without Captive Runtime, so we can try with the latest installed AIR version!.
Thank you!

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X