Common/MatDefs/Light/Lighting not working on Android

Hi all,

Just getting started with jMonkey, and Blender. I have made a cube in Blender and saved the .blend file.

I imported model to a clean app and got it loaded and running just fine on PC.

Then I tried to get it to run on my HTC desire HD.

And I get this error:

11-26 16:27:00.922: ERROR/AndroidHarness(8125):

com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=18, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Error: varying variables do not fit in 8 vectors.

Error: varying variables do not fit in 8 vectors.

SEVERE AndroidHarness 4:27:00 PM Exception thrown in Thread[GLThread 30,5,main]:



at com.jme3.material.Material.renderMultipassLighting(789)

at com.jme3.material.Material.render(1016)

at com.jme3.renderer.RenderManager.renderGeometry(656)

at com.jme3.renderer.queue.RenderQueue.renderGeometryList(301)

at com.jme3.renderer.queue.RenderQueue.renderQueue(357)

at com.jme3.renderer.RenderManager.renderViewPortQueues(893)

at com.jme3.renderer.RenderManager.flushQueue(849)

at com.jme3.renderer.RenderManager.renderViewPort(1125)

at com.jme3.renderer.RenderManager.render(1167)



at android.opengl.GLSurfaceView$GLThread.guardedRun(1363)

at android.opengl.GLSurfaceView$

Now I have tried a few things, if I change the material to a basic one, then that works fine, like this:

Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);

mat.setColor(“Color”, ColorRGBA.Blue);


This appears in the shader name “language=GLSL100”, does that mean my android is being run in opengl1.0 mode? Or is the error more to do with the message “Error: varying variables do not fit in 8 vectors”.

Thanks for any help you can give me.

possibly, try doing inside main(String args[]):


Game app = new Game();

AppSettings appSettings = new AppSettings(true);




Which version of jME3 are you using? This issue should have been fixed already

Thanks for replies,

wezrule, that didn’t make any difference, I even tried inside simpleInitApp as main doesn’t seem to be called on android.

Momoko_Fan, I only downloaded it yesterday, it says it’s jMonkeyEngine SDK 3.0beta in the about, how do I find a more precise version? I also checked for updates and it found some but updating made no difference.

It seems that any attempt to use Lighting.j3md causes the error. I can use “Common/MatDefs/Misc/ShowNormals.j3md” for example just fine.

Here is my simpleInitApp code:


Spatial gameLevel = assetManager.loadModel(“Models/cube/cube.j3o”);

Material mat = new Material(assetManager, “Common/MatDefs/Light/Lighting.j3md”);


DirectionalLight sun = new DirectionalLight();

sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());