I’m busy replacing more of the direct rendering in my game with Vertex Arrays (it was getting too slow on complex scenes). My approach currently isn’t the most efficient since I have a couple hundred VA’s per scene which could probably be reduced to about 20 larger ones. However that’s not my question. I ran the game through YourKit profiler, just to see where the time is now being spent (see below).
I was interested to see quite a big chunk of time being spent in JOGL methods ‘checkArrayVBODisabled’ and ‘checkBufferObject’.
Is this becuase I’m doing something wrong in the way I configure my DirectBuffers? I’m generally doing something like:
FloatBuffer vertexFB = ByteBuffer.allocateDirect(vertexBBSize).order(ByteOrder.nativeOrder()).asFloatBuffer();
From the name it sounds like one of the methods is concened with VBO’s, which I’m specifically avoiding for now to reach more users. So is there some configuration options in JOGL that I can avoid these calls, or is JOGL trying to use VBO’s behind the scene?
I’m just interested if there is anyway to lower these overheads, besides the obvious way of using fewer VA’s
Cheers
Peter
PS Is this still the best forum for JOGL questions like this? It seems very quiet here these days…
Here is the output of YourKit, hopefully formatted reasonably… method,total time in method inc sub calls, time as percent, invocation count
mycode.drawMapObjects(GL, GLU, boolean) 40,943 78 % 111
com.sun.opengl.impl.GLImpl.checkArrayVBODisabled() 18,700 35 % 172,860
com.sun.opengl.impl.GLImpl.checkBufferObject(boolean, boolean, boolean, boolean, int, String) 14,646 28 % 177,077
mycode.ModelTextureRenderer.render(GL) 12,674 24 % 16,931
com.sun.opengl.impl.GLBufferStateTracker.getBoundBufferObject(int, GL) 12,397 23 % 177,077
mycode.ModelWireRenderer.render(GL) 9,665 18 % 16,931
mycode.ModelSolidRenderer.render(GL) 9,526 18 % 16,931
com.sun.opengl.impl.GLImpl.glVertexPointer(int, int, int, Buffer) 8,986 17 % 51,903
com.sun.opengl.impl.GLImpl.glNormalPointer(int, int, Buffer) 8,948 17 % 51,902
com.sun.opengl.impl.GLImpl.glColorPointer(int, int, int, Buffer) 8,935 17 % 51,902
java.util.HashMap.get(Object) 7,931 15 % 177,580