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)
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.
eg:
GLES20.glDrawElements(GLES20.GL_TRIANGLES, indexCount, GLES20.GL_UNSIGNED_INT, 0);
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,
//todo
// 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");
mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
mat.getAdditionalRenderState().setDepthTest(true);
mat.getAdditionalRenderState().setDepthWrite(false);
fire.setMaterial(mat);
TangentBinormalGenerator.generate(fire);
fire.setQueueBucket(RenderQueue.Bucket.Transparent);
this.rootNode.attachChild(fire);