Performance of animated models (binary from OGRE XML)

In my demo application I display an animated model (binary format converted from ogre xml) using a transparent background over the camera image.

The JME camera view is bound to the device orientation.



Unfortunately I only reach a framerate of 15 FPS (Samsung Galaxy S, Android 2.2) displaying a single animated model.



I implemented the same logic in JPCT-AE where I can display one animated model at 40 FPS or 3 animated models at 17 FPS using the BONES library (using OGRE XML as well, they even use the importer code from JMonkey) and even up to 10 animated models at 30 FPS using the model in MD2 format.



Is there any possibility to reach these framerates by making optimizations to the JME code? This is the code to load the model:

[java]

Node ogreModel = (Node) imp.load(activity.getResources().openRawResource(R.raw.oto), null, null);

ogreModel.setLocalTranslation(0, 60, 0);

ogreModel.updateGeometricState();

ogreModel.updateModelBound();



AnimControl control = ogreModel.getControl(AnimControl.class);

AnimChannel chan = control.createChannel();

chan.setAnim("walk");

rootNode.attachChild(ogreModel);

[/java]

I guess the other formats don’t use the lighting shader to display the model, you can set an Unshaded.j3md material to the model to achieve that or edit the material in jMP before.

JPCT-AE might be using native code to accelerate the animation.

Another possible approach is to use hardware skinning, but I don’t know if that will stress the GPU too much.



Someone needs to do more testing on android devices to find out the optimal approach to do skinning. Its possible the best option is not to do skinning at all but to use mesh-based animation (e.g. md3)