Hello,
i’ve trouble with VBOs again, and hope someone of u could help before i get nuts …
In my application i try to realize billboarding based on VBOs. Every billboard is defined by 4 vector objects which are constructed with an zero value. On each frame i calculate the allignment an set the new coords in this objects.
All works fine in imidiate mode based on normal vertex arrays. When i try to use VBOs it only works, when i create every Frame new VBO-Buffer Datas, but the Frame-Rate is the same like in imidiate mode (
When i use glGetBufferData or glMapBuffer, then i can manipulate the coords and set them on the pointers, but i can see nothing during rendering …
Here is my testcode fragment:
// Get the buffer size
int vboSize=0;
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &vboSize);// Init data Pointer
CVector* vboGPUData = (CVector*)malloc(vboSize);//Get Vectors
glGetBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, vboSize, vboGPUData);// Calculate alligment and set them on Data
Object->calculateBillboardAlligment();
vboGPUData = billboard->getVertices();glVertexPointer( 3, GL_FLOAT, 0, (char *) NULL );
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, *billboard->getTextureIDReference());glBindBufferARB( GL_ARRAY_BUFFER_ARB, *billboard->getVBOTextureNameID());
glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL );// reder
glDrawArrays( GL_QUADS, 0,billboard->getVertexCount());
It is possible, that the problems are triggered by texturebinding?
Thanks 4 any help in advance,
Christian