GLSL attribute pointer don't work

I don't know why, but jME doesn't take into account my GLSL attribute pointer  :?



I write a simple example to show my problem :

Here, I try to apply random colors on the vertices of a simple box using a GLSL attribute pointer… It doesn't work on my computer : the box stay black.



The java code :


import java.net.URL;
import java.nio.FloatBuffer;

import com.jme.app.SimpleGame;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.batch.TriangleBatch;
import com.jme.scene.shape.Box;
import com.jme.scene.state.GLSLShaderObjectsState;
import com.jme.util.geom.BufferUtils;


public class GlslAttributeApp extends SimpleGame {
   
   public static void main(String[] args) {
      GlslAttributeApp app =  new GlslAttributeApp();
      app.start();
   }

   protected void simpleInitGame() {
      display.getRenderer().setBackgroundColor(ColorRGBA.gray);
      
      Box box = new Box("box", new Vector3f(-10, -10, -10), new Vector3f(10, 10, 10));
      rootNode.attachChild(box);
      
      TriangleBatch batch = box.getBatch(0);
      int vertexCount = batch.getVertexCount();
      
      FloatBuffer colors = BufferUtils.createFloatBuffer(4*vertexCount);
      for(int i=0; i<vertexCount; ++i) {
         colors.put((float)Math.random()).put((float)Math.random()).put((float)Math.random()).put(1.0f);
      }
      
      GLSLShaderObjectsState glslState = display.getRenderer().createGLSLShaderObjectsState();
      URL vert = GlslAttributeApp.class.getClassLoader().getResource("attribute_vs.glsl");
      URL frag = GlslAttributeApp.class.getClassLoader().getResource("attribute_ps.glsl");
      glslState.load(vert, frag);
      glslState.setAttributePointer("attColor", 4, false, 0, colors);
      glslState.relinkProgram();
      glslState.setEnabled(true);
      
      box.setRenderState(glslState);
   }
}



attribute_vs.glsl :


attribute vec4 attColor;
varying vec4 vColor;

void main() {
   gl_Position = ftransform();
   vColor = attColor;
}



attribute_ps.glsl :


varying vec4 vColor;

void main() {
   gl_FragColor = vColor;
}



If anyone have an idea about that...