Optimiz away3d for android

Software: Away3D 4.x

Avatar
loth, Sr. Member
Posted: 18 February 2013 04:21 PM   Total Posts: 236

i’m on 3d games for android and i see some limitation

need more simple light (current take too hard gpu memory textures)
for exemple make a plane at full screen add point light and colormaterial, you see framerate down to 10 fps. (directional light takes twice memory).
solution is no add light and add static light on map.

need more simple tool for shadow maybe a simple map projection.

also need to resolve probleme on orientation can’t change landscape to portrait (maybe a bug from adobe and stage3d).

and i see probleme with mouse3dEvent but i don’t test well.

Is juste idea, we can do game on android all other test work at full speed smile

   

John Brookes, Moderator
Posted: 18 February 2013 10:53 PM   Total Posts: 732   [ # 1 ]

Yeah agree.
I can get 60fps with Bullet vehicle with Accelerometer and touch on a nexus 7 and no lights.

Add a light and it drops to 23fps.

Look at the game beech buggy blitz with all the effects that has and bullet :(

Its got to be adobe/air and not Away.

Orientation bugs me too. It will rotate 180 deg fine. 90 deg and context loss!

 

   

Avatar
loth, Sr. Member
Posted: 18 February 2013 11:54 PM   Total Posts: 236   [ # 2 ]

for orientation i find solution but is bad

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, onOrientationChanging);
  stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChange );

onOrientationChanging i clear all scene and proxy
_stage3DProxy.dispose();
onOrientationChange i restart all from begin with
setTimeout(initProxies, 100);

 

   

John Brookes, Moderator
Posted: 19 February 2013 12:08 PM   Total Posts: 732   [ # 3 ]

You may want to sit down for this shock wink

//resize func
view.stage3DProxy.recoverFromDisposal(); 

 

   

Avatar
loth, Sr. Member
Posted: 19 February 2013 06:13 PM   Total Posts: 236   [ # 4 ]

well you right
no need remove view only stage3dProxy

so i do
stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChange);
stage.addEventListener(Event.RESIZE, stageResizedHandler);

private function onOrientationChange(event:StageOrientationEvent):void {
  stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
  _stage3DProxy.dispose();
}

private function stageResizedHandler(event:Event):void {
  if (_view != null) {
_view.width = stage.stageWidth;
_view.height = stage.stageHeight;
  }
  if(!_stage3DProxy.recoverFromDisposal()) setTimeout(initProxies, 1);
}

here the .apk test

 

File Attachments
RootTest.zip  (File Size: 276KB - Downloads: 422)
   

John Brookes, Moderator
Posted: 19 February 2013 06:20 PM   Total Posts: 732   [ # 5 ]

Why remove stage3dProxy?
Its all done for you in away.
Just that one line
view.stage3DProxy.recoverFromDisposal();
works.

 

   

Avatar
loth, Sr. Member
Posted: 19 February 2013 06:26 PM   Total Posts: 236   [ # 6 ]

ho yes great smile

 

   

Avatar
Luca, Sr. Member
Posted: 23 February 2013 07:41 AM   Total Posts: 230   [ # 7 ]

smile This is the question…. wink

 

   

Avatar
loth, Sr. Member
Posted: 24 February 2013 12:08 AM   Total Posts: 236   [ # 8 ]

hum when you say 60 with bullet
you mean awayphysics ? in all my test i don’t reach the 60fps (40/50fps)

what you use for step and settings
maybe speed improve if can use flashcc version when air can run it

 

   

John Brookes, Moderator
Posted: 24 February 2013 12:42 AM   Total Posts: 732   [ # 9 ]

Yeah 60fps. with nexus 7
With a light it will average 37fps
Using the flascc verison. Away Physics Alpha Dev branch.

“flashcc version when air can run it”
erm its does run

BUT thats maybe why ive been having issues with flash develop.
It wont compile if I select Air > 3.4

I get an error mutex not initialised
But selecting 3.4 in fd I can still run it.

Had this issue with a previous version of fd when Away released 4.1
http://away3d.com/forum/viewthread/3506/
Im not sure why or what is happening there.

As for step its deltaTime and sub step of 3. But fixed would still give 60.


Basically my optimisation advice is buy everyone a nexus :/

 

   

Avatar
loth, Sr. Member
Posted: 24 February 2013 12:57 AM   Total Posts: 236   [ # 10 ]

smile yep, i’m testing with 3.6 same mutex error
you don’t have probleme with deltaTime and car wheels ?

yes nexus 7 is great

 

   

John Brookes, Moderator
Posted: 24 February 2013 12:59 AM   Total Posts: 732   [ # 11 ]

No you have to rebuild the physics swc with a fix to the source to use delta.

 

   

Avatar
loth, Sr. Member
Posted: 24 February 2013 01:02 AM   Total Posts: 236   [ # 12 ]

i see old post about, but you can send me that please

 

   

John Brookes, Moderator
Posted: 24 February 2013 01:02 AM   Total Posts: 732   [ # 13 ]

Just had a quick look

AwayPhysics.c
line 944
vehicle->updateWheelTransform(j,true);

change to false and rebuild swc with flascc

If you dont manage that give me a shout tomorrow. Late here and fine wine smile
The one I have at the moment also has other stuff which require edits to the source.

 

   

Avatar
loth, Sr. Member
Posted: 24 February 2013 01:42 AM   Total Posts: 236   [ # 14 ]

yes no problem smile
i’m on simple test 64 box on plane
deltatime or base step is same

 

   

Avatar
loth, Sr. Member
Posted: 24 February 2013 12:08 PM   Total Posts: 236   [ # 15 ]

well my advanced_CarPhysicsDemo work !
need to add starling layer for text and cool pad and is rock smile

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X