Jump to content
  • Advertisement
Sign in to follow this  
parmar

VBO performance Issue

This topic is 3540 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi List, I have implemented VBO for our project,but it not getting any fps gain.Please help me on this issue. Regards, Parmar.

Share this post


Link to post
Share on other sites
Advertisement
Could you elaborate a bit on your previous and current solution?

Just saying you now use VBOs without telling us what you used before, how you utilize the VBOs etc. doesn't help much.

Share this post


Link to post
Share on other sites
Thanks for reply.
Earlier i was drawing the model using glDrawElements without using
VBO.
Code Without VBO.

glVertexAttribPointer ( positionLoc, 3, GL_FLOAT,
GL_FALSE, 3 * sizeof(GLfloat),data);

glEnableVertexAttribArray (positionLoc );



glUniformMatrix4fv(mvpLoc, 1, GL_FALSE, (GLfloat*) &mvpMatrix.m[0][0] );


glDrawElements ( GL_TRIANGLES,numIndices, GL_UNSIGNED_INT, indices);

Now i am drawing the same model using VBO but i am not getting any performance
gain.

Code With VBO.

glBindBuffer( GL_ARRAY_BUFFER, id );
glVertexAttribPointer ( positionLoc, 3, GL_FLOAT,
GL_FALSE, 3 * sizeof(GLfloat),NULL);

glEnableVertexAttribArray (positionLoc );


// Load the MVP matrix
glUniformMatrix4fv(mvpLoc, 1, GL_FALSE, (GLfloat*)mvpMatrix.m[0][0] );


glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, id1 );
// Draw the cube
glDrawElements ( GL_TRIANGLES,numIndices, GL_UNSIGNED_INT, NULL/*indices*/ );

App is working fine,but not getting any performance gain.I am generating the VBO id once and deleting at the time of exit.

Share this post


Link to post
Share on other sites
So you did use VertexArrays before?

Basically, they are the same as VBOs except for the memory they reside in. VAs reside in RAM and are transferred to the GPU when needed, VBOs reside in VRAM (so no need for transferring each time they are use, except when being updated).

The performance gain depends on the size of data stored in each array. For small arrays/VBOs the gain should almost be unnoticable, for larger blocks of data (1000+ vertices?) there might be a noticable gain.

But maybe you're not bandwidth limited. The bottleneck might lie elsewhere (fill rate, transform rate, etc.)

Share this post


Link to post
Share on other sites
Thanks Lord_Evil for your help.
My model data is more than 1000 vertices.
I think my bus is not busy,killing the performance in setting the uniform in shader.I am trying to find out the reason for not getting performance.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!