OpenGL Error 1285

Hello,

I am trying to test my game on a CT1010 tablet running on Android 4.0.4
I get the following error:

W/dalvikvm( 9395): threadid=11: thread exiting with uncaught exception (group=0x40a671f8)
E/AndroidHarness( 9395): Exception thrown in Thread[GLThread 480,5,main]
E/AndroidHarness( 9395): com.jme3.renderer.RendererException: OpenGL Error 1285. Enable error checking for more info.
E/AndroidHarness( 9395): at com.jme3.renderer.android.OGLESShaderRenderer.onFrame(OGLESShaderRenderer.java:559)
E/AndroidHarness( 9395): at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:334)
E/AndroidHarness( 9395): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462)
E/AndroidHarness( 9395): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)

Has anyone got an idea on how to fix this please ?

You ran out of GPU memory.
Make your textures smaller.

Really ? StatsView indicates the following:
Textures (M): 22
Textures (F): 19
Textures (S): 19

Is that all an ARM Mali-400 MP GPU tablet can handle ?

Thats the amount not the size.

19 1024x1024 textures take a lot more memory than 19 128x128 textures :slight_smile:

Now I also run into OpenGL Error 1285, but not always.
I checked the Heap Size of the game process using the Android Debug Monitor. The memory allocation stays between 13 and 15 mb. What is the upper limited running into OpenGL Error 1285?

Heap size on Android can generally run between 16MB and 43MB depending on the device and version of Android that you are using. You can use the following to see what the size is
[java]
long heapMax = Runtime.getRuntime().maxMemory(); // max capable
long heapTotal = Runtime.getRuntime().totalMemory(); // current heap size max, can grow as necessary up to maxMemory
long heapFree = Runtime.getRuntime().freeMemory(); // current free heap (totalMemory-usedMemory)
[/java]

However, I don’t think this is the same memory as the 1285 error is for. I believe that is for GPU memory which depends on the graphics hardware used.

2 Likes

That’s not a heap size issue…that’s a GPU memory issue.
You have to down size your textures.

That’s disappointing though… I am only displaying the Oto model in the town scene from JME3 test data plus a few boxes.
Is there a way to see the maximum texture size I am allowed to use ?

@MathiasGO said: That's disappointing though...
Get used to it. When you go from Desktop to Android it's disappointment all over the place.
@MathiasGO said: Is there a way to see the maximum texture size I am allowed to use ?
There is, but that would be useless in that case, because you don't break this limit, it's just that you have too much or too big textures. Also, very often you don't need big texture size. Phones, or tablets have relatively small resolutions (well that's not gonna last long though). Oto has a 1024x1024 texture, let's say you have a 1200 x 720 resolution, you'd need it to occupy almost the whole screen, so the texture has to be stretched. this only occur when you zoom in a lot on the character. town.zip has 512x512 textures, and that's a bit too much too considering they'll seldom be displayed in full screen.

I’m surprised though that it’s enough to have an OOM…what’s your tablet?
Do you have a skybox? Skybox can easily be oversized.

2 Likes

Thanks for this nehon.
My tablet is a CT1010 with a dual core Mali-400 MP GPU, supporting OpenGL ES 2.0 with 256 KiB of L2 cache. A cheap tablet but good enough to run Grand Theft Auto III on it.

I will investigate the skybox route. Any JME ressource or tutorial recommended to start with ?

if you have a skybox, remove it and see if it fixes the issue :slight_smile:

I don’t have a skybox unless the town scene has one built-in. How can I check that ?

Galaxy S2 seems to have only about 3 mb VRAM.

[java]adb pull /dev/graphics/fb0
3171 KB/s (3072000 bytes in 0.946s)
[/java]

Even removing the skybox from the scene did not resolve the problem of error 1285.

How can those awesome looking android games like NOVA 3 get along with only 3 mb of video ram?

So it’s not just failing on your tablet?

Could you make a testcase for this, it’s strange…

@mathias4u said: How can those awesome looking android games like NOVA 3 get along with only 3 mb of video ram?

Good question, has anyone an idea how they do it? I use an Samsung S3 and a Galaxy Nexus and on the slower less powerfull nexus I have much less problems. Is the texture size the only thing that can throw the 1285 error?

@mathias4u said: Galaxy S2 seems to have only about 3 mb VRAM.

[java]adb pull /dev/graphics/fb0
3171 KB/s (3072000 bytes in 0.946s)
[/java]

Even removing the skybox from the scene did not resolve the problem of error 1285.

on the samsung s3:
adb pull /dev/graphics/fb0
2975 KB/s (7372800 bytes in 2.420s)

on the galaxy nexus:
adb pull /dev/graphics/fb0
3247 KB/s (16777216 bytes in 5.045s)

that would explain why my nexus has less problems. is “adb pull /dev/graphics/fb0” the correct way to read the vram of the device? from opengl es - How to measure VRAM consumption on Android? - Stack Overflow i read that most devices use the normal RAM:

You typically do not have a dedicated "VRAM" on mobile devices. At least you don't have it with PowerVR architectures (wich totally dominate the market with their MBX and SGX cores). That is, the OpenGL driver allocates normal RAM until you run out of it, and the more you allocate the less you have left for your application.

That’s not VRAM, that’s the size of the framebuffer. 800x480x8 = 3072000.

1 Like

So killing all other apps on the device before launching the game should then theoretically help?:wink: