Whether the jMonkeyEngine support IntBuffer?

Hello everyone, I want to know whether the jMonkeyEngine support IntBuffer, if support how do I use it. Thank you very much.

When I test my app, I got this

04-21 15:31:56.995 29506-29520/com.juyee.bim E/com.jme3.app.AndroidHarness﹕ SEVERE Exception thrown in Thread[GLThread 4369,5,main]
com.jme3.renderer.RendererException: OpenGL ES does not support 32-bit index buffers.Split your models to avoid going over 65536 vertices.
at com.jme3.renderer.android.OGLESShaderRenderer.drawTriangleList(OGLESShaderRenderer.java:2120)

I need your help ,thanks.

JME does, not openglES.
If you have less than 65535 vertices JME uses a ShortBuffer for buffers like index and boneindex, else it uses an IntBuffer.
the problem is that IntBuffers are not supported by ogl es, hence this error.

So you have to follow the advice and split your model so that you have meshes of less than 65535 vertices.

the problem is that IntBuffers are not supported by ogl es, hence this error.

When I test the ogl es2.0, I used the IntBuffer and it performance well.
GLES20.glDrawElements(GLES20.GL_TRIANGLES, indexCount, GLES20.GL_UNSIGNED_INT, 0);

Could you explain this for me? Thanks.

Mhh I remember there was an issue. @iwgeric do you remember what was the issue about IntBuffers?

So you mean this, I should’t try to use IntBuffer when I use jMonkey in android?

I think you need to use a shortBuffer for indexes with android. Desktop doesn’t mind.

    mesh.setBuffer(Type.Position, 3, BufferUtils.createFloatBuffer(gateGroupVertexes));
    mesh.setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(gateGroupTexCoords));
    mesh.setBuffer(Type.Index, 1, BufferUtils.createShortBuffer(gateGroupIndexes));

The explanation is in the exception description.
You will need to ask more specific questions than “can you help me?”.

I want to use IntBuffer through jMonkey in android. I think if I use IntBuffer in android the performance will be improved. Thanks for your reply.

You cannot use IntBuffer on Android. That’s what the error message says.
You cannot use it because its not supported by OpenGL ES, it has nothing to do with jME3. As the message says, you should be using ShortBuffer instead.

I know the IntBuffer is supported by ogl es 2.0, why do you say so.

When I delete the code in the source,


// if (indexBuf.getFormat() == Format.UnsignedInt) {
// throw new RendererException(“OpenGL ES does not support 32-bit index buffers.” +
// “Split your models to avoid going over 65536 vertices.”);
// }

the app run normally, is there any other problem ? Why the JME3 throw the exception? Do you know this? Thanks.

IntBuffer support requires a specific OpenGL ES extension, i.e. it is only supported on certain devices. Probably your device supports it which is why your application runs. However IntBuffers are likely to be slower due to higher memory usage, so just because it works doesn’t mean it is a good thing.
In jME3.1, the extension is checked and IntBuffers are allowed to be used:

Hi guys, I also get this error when running on android, but my code that causes it is

      final Spatial fire = this.assetManager.loadModel("TestModels/FakeParticleBlow/FakeParticleBlow.j3o");
      final Material mat = this.assetManager.loadMaterial("TestMaterials/FakeParticleBlow/FakeParticleBlow.j3m");

And here is the link: TestFakeParticleBlow.java

I’m trying to test FakeParticleBlow for the fire effect. How can I change it to short here? Sorry I’m pretty new to this. (btw works good on pc)