Performance with many objects, low fps

Started by MemphisM, February 13, 2014, 10:01:52 AM

Previous topic - Next topic

MemphisM

First of all, thanks for the wonderful 3D engine.

I create Android app with many object3D. I need to know the parameters of each object, such as сenter, vertices, bounding box. Each object consists of 2-20 triangles and will respond to collisions (setCollisionMode(Object3D.COLLISION_CHECK_OTHERS)). And I use forceGeometryIndices(true);

The results:
186 Objects  - 24 fps and 186 draw calls per frame;
552 Objects - 12 fps.

Phone:
512 MB RAM
CPU    1 GHz
GPU    Adreno 205
Android 4.0

How to reduce draw calls and improve fps in my case?


EgonOlsen

Isn't that pretty obvious? Use less objects or, if possible, merge multiple objects to one. Each object requires at least one draw call. If it uses multiple textures, it will require even more.

EgonOlsen

Apart from that, these are pretty low specs. What device is that, a Nexus One?

MemphisM

Thanks!
My device is HTC One V.
I don't use any textures, only setAdditionalColor.

Unfortunately, I can't reduce the number of objects. Is the only way merge objects to one (In app I need to choose each object by touching)?

EgonOlsen

Each object means one draw call. There's no way around this, because that's the way in which OpenGL works.

MemphisM

I didn't say that the objects may overlap each other. For the overlapped objects I set visibility (obj.setVisibility(false)). And fps has improved.

Varanda

Hello,

I am searching on the forum for performance numbers but I was not able to find much data.
I would like to get a sense how much vertexes I can have in my scene to get >15 fps running in a 2 year old Android.
Also, how "expense" is bone animation (if relevant in terms of FPS dropping).

Is there any topic where developers report numbers like that?

Thanks,
Varanda

EgonOlsen

That's a rather difficult question, because it depends on a lot of things. It depends on the device ("2 years old" can be everything from some crappy $60 device up to a Galaxy S5), on the version of Android (because with 5.0, we had this shift in runtimes from Dalvik to ART) on your scene (a high polygon count can be caused by one or two larger objects as well as by many small ones and the performance differs largely between both even if the polygon count is actually the same), on the throttling strategy of the device etc...
As a rule of thumb, larger but few objects are usually faster than more but smaller ones. Rendering lots of polygons isn't as expensive as making lots of draw calls is.
For example, my game Naroth (https://play.google.com/store/apps/details?id=com.threed.jpct.games.rpg) runs @ around 20fps on most older devices. It renders one terrain with approx. 7000 polygons and many small objects like trees, bushes, gras, enemies, houses, particles etc, which range from 1 to 800 polygons each.

It might help to know, what exactly you want to render.

Varanda

Naroth looks fantastic. Left a rate/review there. It is a big motivator for anyone to choose jPCT. I am sold already... will bug you guys for the nex few months :-)

My game will be much simpler. It has political motivation to fight corruption in Brazil... it will focus more on sending a message than the gameplay itself.
However, I believe that will be fun. A corrupt guy is climbing a particular building in a KingKong style; the Player, first person with a small chopper cockpit overlay, will flies around the building shooting fruits towards the kong. The idea is to stop him to reach the top. surround the building are other building (a couple 3D but most drawn in the Skybox). Kong can throw back rocks and may damage the chopper. All these elements have political meaning. I want to deliver this game ASAP to take advantage of the current political context; otherwise, It may not make much sense anymore.

Thanks for your help,
Varanda

EgonOlsen

That doesn't sound too complicated at first glance. An older device should be able to handle that just fine.