Tablet performance tips ? ( android )

Software: Away3D 4.x

doomdrake, Newbie
Posted: 09 May 2012 02:20 PM   Total Posts: 14

Hi guys, i’ve built a solar system and even though it works ok on a Desktop ( event though the fps varies from 30 to 60 ), it staggers ( low fps ) really bad on a tablet ( in some cases ).

So i’ve decided to ask for some tips & tricks since none of the threads related to performance issues seems to apply to my specific problems.

The low fps occures when a part of an object covers the whole screen ( like looking at a portion of the Sun for example ). Also, i can’t make a SkyBox render on any tablet so far ( major bummer tbh ).

First of all, each planet has a different material and moves on a different trajectory using PathAnimator so i can’t really use the Merge / Clone methods that i’ve been reading so much about.
The orbits are “drawn” using SegmentSet( LinearExtrude didn’t do the job for me visual wise ).
I would also like to mention that no filters are applied to the scene and that the maximum polygons on the screen at any given time is about 45k, the average being 10 - 15k.
=======================================================
Below is the planet + PathAnimator ( the path is extracted from the orbit creation which is not relevant ) creation code ( that should be the core of the problem i think )

/**
   * Builds the solar system based on the data read from a config XML file
   */
  
private final function buildPlanets():void
  {
   trace
("> Adding lights");
   var 
light:PointLight = new PointLight();
   
light.fallOff light.radius Number.MAX_VALUE;
   
light.ambient .2;
   
light.diffuse 100;
   
   var 
sunLight:PointLight = new PointLight();
   
sunLight.ambient 1;
   
sunLight.specular 0;
   
_scene.addChild(sunLight);
   
_picker = new StaticLightPicker([light]);
   
_scene.addChild(light);
   
   var 
orbit:OrbitCreator = new OrbitCreator();
   
_animators = new Vector.<PathAnimator>;
   
trace("> Building system");
   var 
sunPicker:StaticLightPicker = new StaticLightPicker([sunLight]);
   
_orbits = new Vector.<SegmentSet>;
   var 
orbitV:Vector3D;
   
   for (var 
i:uint 0_planets.length; ++i)
   
{
    
if (!= 0)
    
{
     orbitV 
= new Vector3D(_infoXML.orbit[i 1].@radiusX ScaleRatios.SCALE_infoXML.orbit[i 1].@yPlacement ScaleRatios.SCALE_infoXML.orbit[i 1].@radiusZ ScaleRatios.SCALE);
     
_planets[i].orbitV.x;
     
_planets[i].init(_infoXML.planet[i].@size ScaleRatios.PLANET_SCALEValues.SPHERE_SEGHValues.SPHERE_SEGV_picker_infoXML.planet[i].@ringRadius_infoXML.planet[i].@ringAngleX_infoXML.planet[i].@ringAngleY);
     
_orbits.push(orbit.buildOrbit(_infoXML.orbit[i 1].@xPosorbitV.xorbitV.yorbitV.z_infoXML.orbit[i 1].@tilt));
     
_scene.addChild(_orbits[_orbits.length 1]);
     
_animators.push(new PathAnimator(orbit.path_planets[i]nullfalse));
    
}
    
else
    
{
     _planets[i]
.init(_infoXML.planet[i].@size ScaleRatios.PLANET_SCALEValues.SPHERE_SEGHValues.SPHERE_SEGVsunPicker);
     
_planets[i].terrain.material.repeat true;
    
}
    _planets[i]
.initRotations(_infoXML.planet[i].@rSpeed_infoXML.planet[i].@aSpeed ScaleRatios.SPEED_SCALE);
    
    if (
_planets[i].hasAtmosphere)
     
_planets[i].atmRot _infoXML.planet[i].@atmSpeed;
    
_scene.addChild(_planets[i]);
   
}
   _planets[6]
.ring.material.lightPicker sunPicker;
   
_planets[7].ring.material.lightPicker sunPicker;
   
   
// ----START SKYBOX CREATION----
   
var bmd:BitmapData = new SkyMap().bitmapData;
   
_scene.addChild(new SkyBox(new BitmapCubeTexture(bmdbmdbmdbmdbmdbmd)));
   
// ----END SKYBOX CREATION----
   
   
trace("> Adding interaction");
   
this.dispatchEvent(new Event("solarSystemCreated"truetrue));
   
_controller.update();
   
_controller.steps 40;
   
addEventListener(Event.ENTER_FRAMEupdateScreen);
  

 

   

idettman, Newbie
Posted: 09 May 2012 07:51 PM   Total Posts: 2   [ # 1 ]

What are the specs of the tablet having issues? Check the type of GPU and see what the specs are. You may be running into a weak GPU, which some Android devices are notorious for

   

Avatar
Fabrice Closier, Administrator
Posted: 09 May 2012 10:46 PM   Total Posts: 1265   [ # 2 ]

what happends to the fps if you remove the lightpicker?
If it runs better, i would use a light map for the planets, after all, you have only one source of light and the map could shared with all spheres. You would have only a custom code required to offset the uvs runtime for the second uv set so that each map is applied in the same direction as the sun.

Regarding segments, if they do use the Path, why not use PathExtrude? you simply need a circle profile and you would get them way nicer than using segments.

   

doomdrake, Newbie
Posted: 10 May 2012 08:03 AM   Total Posts: 14   [ # 3 ]

@idettman: i have tested the application on an Asus transformer which indeed has a weak GPU and on a Motorola xoom on which the application runs better ( it has a better GPU since the content looks better )

@fabrice: haven’t tried removing the lightpicker and as in terms of lightmaps, i would avoid them since i have no idea how to use them ( uv’s are a mistery to me ).
I’ve used line segments because LineExtrude ( seemed easier to use than PathExtrude ) made the orbits have a faded color when seen from a large distance ( most likely it’s from the way the light is computed ). If i am missing something, please enlighten me smile

On a side note, it seems that a SkyBox does not show at all on the Asus tablet ( didn’t test on xoom because i didn’t have one at the time ) regardless of the lens far / near clipping values.

   

doomdrake, Newbie
Posted: 14 May 2012 08:00 AM   Total Posts: 14   [ # 4 ]

So no clue as to what i’m doing wrong or tips & tricks ? raspberry

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X