I hava a custom subclass of mesh where I manually generate meshes, i calculate the normals for the triangles and put them in a normal list which is then converted to a float buffer (see code below) and set as a normal buffer of the Mesh object. This all works fine on the desktop and also looks correctly. But when i run it on an android phone the following error is thrown:
[java]06-13 14:50:25.605: W/System.err(26786): com.jme3.renderer.RendererException: OpenGL ES does not support 32-bit index buffers.Split your models to avoid going over 65536 vertices.
06-13 14:50:25.610: W/System.err(26786): at com.jme3.renderer.android.OGLESShaderRenderer.drawTriangleList(OGLESShaderRenderer.java:2115)[/java]
here is the code which is relevant:
[java
]if (normals.size() > 0) {
float[] list = listAsArray(normals);
FloatBuffer normalbuffer = BufferUtils
.createVector3Buffer(list.length);
normalbuffer.put(list);
this.setBuffer(VertexBuffer.Type.Normal, 3, normalbuffer);
}
…
private float[] listAsArray(ArrayList<Vector3f> normals) {
float[] r = new float[normals.size() * 3];
for (int i = 0; i < normals.size() * 3; i += 3) {
r[i] = normals.get(i / 3).x;
r[i + 1] = normals.get(i / 3).y;
r[i + 2] = normals.get(i / 3).z;
}
return r;
}
[/java]
i used the box class to understand how to set the normal buffer and the box is displayed without problems on android so I dont geht what the problem is, how do i have to create the buffer?