Author Topic: Loading Bones on Android  (Read 69985 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Loading Bones on Android
« Reply #30 on: September 04, 2011, 10:34:52 pm »
On my N1, animating 8 Ninjas barely increased from 20 fps to 21 fps, I dont know why. But I'll still keep the modification. %5 percent is good enough.
My test case rendered only one ninja, but applied the animation 10 times to it in a frame...to stress the animation part more than the rendering itself.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #31 on: September 04, 2011, 10:43:45 pm »
Oh, good to know: animatedGroup.get(0).touch() still renders at 60 fps.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #32 on: September 04, 2011, 10:46:05 pm »
My test case rendered only one ninja, but applied the animation 10 times to it in a frame...to stress the animation part more than the rendering itself.

i see. so we get something around 5% overall

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #33 on: September 04, 2011, 10:47:01 pm »
@AGP have you tried replacing Ninja model with your model?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #34 on: September 04, 2011, 10:57:57 pm »
I did the opposite test and got that version mismatch message. Would the reverse work?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #35 on: September 04, 2011, 10:59:31 pm »
with latest version, both tests should work. i especially recommend replacing ninja with your model first

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #36 on: September 04, 2011, 11:01:24 pm »
Cool, I'll report back in a second.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #37 on: September 04, 2011, 11:29:45 pm »
OK, 12-13 fps with your ninja demo (exactly the same as mine when I don't call animatePose()). So I'm already experiencing a boost of 20% (didn't really get your conclusion of 5 and now have confirmed 20 in practice). That's a little better but not enough.
« Last Edit: September 04, 2011, 11:45:55 pm by AGP »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #38 on: September 05, 2011, 12:03:28 am »
can you please post fps of:

* ninja demo with 3 ninjas
* ninja demo with your model

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #39 on: September 05, 2011, 12:42:46 am »
12-13 fps with my model, 59-60 fps with 3 ninjas.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #40 on: September 05, 2011, 12:54:03 am »
really strange ::) the only explanation i can think of is, your model skinned too heavily. ie: each vertex is influenced by a lot of joints. but still IMHO it shouldnt differ that much.

send me your model and i'll have a look. i'll PM my email

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #41 on: September 05, 2011, 08:13:20 pm »
Five ninjas and it's still at 60 fps. I didn't bother test with more, but clearly it can take more ninjas.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #42 on: September 05, 2011, 09:34:28 pm »
i've inspected your model. it seems as it's more complex then you said

a few numbers:
Code: [Select]
             ninja     your model
vertices     781+61       28720
joints         28           66

according to these numbers slow down is expected. if your model is really 9300 polygons all vertices should be distinct. even so, there are some extra vertices ::)

@Egon I don't know why object compiler reports 2712+312 vertices for ninja. i get these numbers from VertexController.getSourceMesh()


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Loading Bones on Android
« Reply #43 on: September 05, 2011, 09:55:32 pm »
Because i took these numbers from the desktop version, which doesn't compile to indexed geometry by default, i.e. it results in triangles*3 vertices. Animation processing will still happen on the 781 vertices you mentioned. The compiled pipeline will map between the two formats at runtime. My bad...i should have noticed this earlier. jPCT-AE compiles to indexed geometry by default, at least for animated objects.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #44 on: September 06, 2011, 12:06:00 am »
Except that it's not more complex then I said (the number of polys here refers to squares rather than tris):

Multiply by two to get the exact number of tris (but the burger isn't skinned so you'd have to subtract its polys and vertices to get a relevant number).

And again, Unity does it at 60 fps. Since it's not jPCT, I see no reason why bones in a Java VM should be any slower than in a native machine.
« Last Edit: September 06, 2011, 12:12:50 am by AGP »