Float/byte/Buffer overhead

As some of you guys have actually developed a working games with LWJGL, I’d like to know how the use of buffers affect the rendering speed?

For example is it better to build your own rotation matrix instead of letting the gl do the calls through buffers? What about minimizing the use of buffers with doing more stuff java side. I haven’t seen any NIO benchmarks so how would I know.

So, how big is it really?

Pretend that you have three depots. One is called Java, the other, GL, and the last depot, Video Card.

If you imagine every function call being a single lorry which can carry an unlimited amount of data travelling from one depot to the next you can get a pretty good idea of what the efficiency will be like. Especially if you think that there’s a 20 mile drive between the depots and only one lorry fits at a time.

IOW, if you want to construct a rotation matrix, consider this:

You first have to create it on the Java side, then you have to send it to GL; then you have to send it to the video card.

Alternatively you can get GL to create it and send it to the card directly. Saving you a 20 mile lorry drive.

Cas :slight_smile:
(under influence of champagne again)

Yeah, I sort of figured that out.

What about excessive buffer calls? I guess I have to reduce the amount of buffer calls in order to keep the code as fluent as possible.