Game Development Community

Enabling vertex buffer support

by Manoel Neto · in Torque Game Engine · 04/05/2006 (4:26 pm) · 1 replies

Did anyone obtained success in making TGE use the ARB_vertex_buffer_object extension?

I'm in a struggle to make TGE faster when rendering TSStatics, and I got curious to see if the TSShape code was using vertex buffers (it should, I'm on a GF6600).

But it wasn't (as I suspected), because dglDoesSupportVertexBuffer() always returns false. I traced the call, and it returns gGLState.suppVertexBuffer, that never ever gets set to true anywhere in the whole source code. I added a check in GL_EXT_Init() to check for the ARB_vertex_buffer_object extension and set it true if found. Bingo, it was now being set to true, but now TGE crashed hard and nice upon loading a mission (I was sorta expecting this).

The crash occurred in the terrain's renderBlock() function, propably because this line doesn't work as it should:

if (vertexBuffer)
                  mXFVertices = (EdgePoint *) glLockVertexBufferEXT(block->mVertexBuffer, VertexBufferSize);

The variable mXFVertices remains NULL after this, and causes the crash later. Past this point I'm led to believe that the vertexBuffer code is either incomplete, or it's supposed to work only in D3D mode (which I can't test because our TGE build has long ago stopped working with D3D, due to too many changes). Does anybody know what's missing there?

#1
04/09/2006 (12:23 pm)
The vertex buffer support that TGE has in by default is DirectX based.