RendererException

Hello guys,



I’m running my jme app under cavas mode and got the following exception when loading a model, Sign Post.mesh.j3o, from the jme test package:



[java]

com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=16, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Fragment shader(s) failed to link, vertex shader(s) linked.



at com.jme3.renderer.lwjgl.LwjglRenderer.updateShaderData(LwjglRenderer.java:1108)

at com.jme3.renderer.lwjgl.LwjglRenderer.setShader(LwjglRenderer.java:1143)

at com.jme3.material.Material.renderMultipassLighting(Material.java:793)

at com.jme3.material.Material.render(Material.java:1010)

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

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

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

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

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

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

at com.jme3.renderer.RenderManager.render(RenderManager.java:1162)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:264)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)

at com.jme3.system.lwjgl.LwjglCanvas.runLoop(LwjglCanvas.java:199)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)

at java.lang.Thread.run(Thread.java:619)

[/java]



Is the model wrong? Should I better not use it?

Thanks in advance!

Hello guys, I’ve found on this forum a report regarding this same problem and it had something to do with the graphic card/driver. No problem then, I’ve tested it in another computer and everything worked fine.



The only thing is that I would like to avoid that if this error occurs the whole application needs to be restarted. For that, I would like to only reset the canvas to a valid state. However, I’ve already tried everything and the application gets stuck if I try to reset the canvas / context.



Does someone have a snippet of code to reset it properly? I’m currently trying this:



[java]

jPanel2.remove(ctx.getCanvas());

jPanel2.validate();

if (ctx.isCreated()) {

ctx.destroy(true);

}

canvas.setSettings(new AppSettings(true));

canvas.createCanvas();

ctx = (JmeCanvasContext) canvas.getContext();

ctx.setSystemListener(canvas);

Dimension dim = new Dimension(640, 480);

ctx.getCanvas().setMinimumSize(dim);

jPanel2.add(ctx.getCanvas());

jPanel2.validate();

progress.progress(“Creating new context…”);

canvas.startCanvas(true);

jPanel2.repaint();

[/java]



…maybe should I remove the “true” parameter and run it in a dispatch thread?



Thanks in advance!