Possible no Hardware Acceleration on Android armv7l jMonkeyEngine 3.1-5468

Hi,

I’m getting low framerates (10p fps) on my android game. I’m suspecting I have no hardware acceleration. On the pc version of the game I get up to 400 fps.

I added the following code to the main activity to try to confirm my suspicion:

@Override
public void onCreate(Bundle savedInstanceState) {
    System.out.println("Hardware accelerated: " + (getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED));
    super.onCreate(savedInstanceState);
}

The output is “Hardware accelerated: 0”

I also configured my device to flash the screen when something is drawn using the GPU. When I run my game, nothing flashes.

I built jMonkeyEngine 3.1-5468 from source so my armv7l device would pass the is64 check. In older versions the armv7l throws a “not supported architecture” error, that’s why i built it from sources (so I can continue developing my app until the 3.1 version is released).

I enabled android:hardwareAccelerated=“true” on android manifest file and my application uses multidex.

I have the following jars:

libs/jme3-android-3.1.0-SNAPSHOT.jar
libs/jme3-android-native-3.1.0-SNAPSHOT.jar
libs/jme3-core-3.1.0-SNAPSHOT.jar
libs/jme3-effects-3.1.0-SNAPSHOT.jar
libs/jme3-lwjgl-3.1.0-SNAPSHOT.jar
libs/jme3-niftygui-3.1.0-SNAPSHOT.jar
libs/jme3-plugins-3.1.0-SNAPSHOT.jar

How do I confirm if I’m having hardware acceleration and how to enable it?

All 3D applications on Android use hardware acceleration. Android does not support software rendering for 3D applications.

The reason why the framerate is low is because Android devices are significantly underpowered compared to desktop computers. You may want to post a screenshot of your application including stats so we could see if things could be better optimized for Android.

Here is a screenshot of the desktop application with stats:

Its a Rocksmith clone that plays MusicXML files.

I got now 30 fps. This is what I did:

  1. The camera was far away and zoomed to reduce perspective skew. I put the camera more close to the fretboard and adjusted frustum:

    getCamera().setFrustumNear(1.8f);
    getCamera().setFrustumFar(100f);

  2. The lane was moving towards the camera. I made the camera move ahead by the lane.

These two modifications raised the fps from 10 to 30.

I think one of the issues is that you have a lot of objects in the scene that really should be just one object.