Exception on texture too large in Android

I get the following exception when I try to run my Android app on an Android device from the JME dev environment. Other than a few fonts, the only textures I have are in a skybox. Each face in the skybox is is 256x256 and the code to create it is below. I’m not sure where the Image[size=8192x8192 in the log exception report is coming from as I have no textures like that.

10-16 14:38:22.669 24006 24017 W dalvikvm: threadid=9: thread exiting with uncaught exception (group=0x40018560)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: SEVERE Exception thrown in Thread[GLThread 10,5,main]
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: com.jme3.renderer.RendererException: Cannot upload texture Image[size=8192x8192, format=Depth, id=70001]. The maximum supported texture resolution is 2048
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.android.OGLESShaderRenderer.updateTexImageData(OGLESShaderRenderer.java:1715)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.android.OGLESShaderRenderer.setTexture(OGLESShaderRenderer.java:1758)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.material.MatParamTexture.apply(MatParamTexture.java:86)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.material.Material.render(Material.java:1088)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:523)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:322)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:374)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:763)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:719)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:983)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.app.AndroidHarness.update(AndroidHarness.java:467)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:349)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
10-16 14:38:22.669 24006 24017 E com.jme3.app.AndroidHarness:

Texture west = Main.mainAssetManager.loadTexture (multiTextureSkyBox [0]);
Texture east = Main.mainAssetManager.loadTexture (multiTextureSkyBox [1]);
Texture north = Main.mainAssetManager.loadTexture(multiTextureSkyBox [2]);
Texture south = Main.mainAssetManager.loadTexture (multiTextureSkyBox [3]);
Texture up = Main.mainAssetManager.loadTexture (multiTextureSkyBox [4]);
Texture down = Main.mainAssetManager.loadTexture (multiTextureSkyBox [5]);

skyGeometry = (Geometry) SkyFactory.createSky (Main.mainAssetManager, west, east, north, south, up, down);

If you leave the skybox out does the exception go away? If not then it wasn’t the reason.

Start commenting things out until you find the culprit. Do you have filters? Shadows? etc?

The texture format is “Depth”, the only thing that uses depth textures in jME3 is shadows. So, do you have any shadows enabled?

@Momoko_Fan, pspeed:

Thanks for the help. I tracked down the problem as being a shadowMapSize that I had made very large. I’ve got my app running now, but it runs differently than it did on my desktop.

The skybox is blue on the desktop, but brown on Android.

I use SimpleWaterProcessor water, but there are many artifacts in water surface. Is waterProcessor.setRenderSize the solution for that?

There is a waterProcessor.setLightPosition method, but it does not seem necessarly. What does it do?

I had to reduce the logging to Level.SEVERE to get the app to even download into the phone. I’ve read notes about logging being a problem on Android, is there any way to get more detail to work?

As far as I can tell, JME IDE does not offer a way to browse the Android file system or control the app during debug. Is that right?

I opened the phone in Eclise and browsed the file system. I could see the log using Logcat when I executed from the phone, but could not find where it installed my app. Where can I find that and any user and log files associated with my app? Can Eclipse be set up to debug a JME app on a phone?