Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: how to Use VBO the right way?

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    15

    how to Use VBO the right way?

    Hello, I have a question on which case to use VBO

    I read some tutorial and learn how to make it work, but I have some doubts, on when and how to use VBO for example.

    1-I am assuming for a mesh that uses skeletal or vertex animation is not convenient because of all vertices are calculate very frequently, right?
    2-do I have to create a VBO for every mesh in the world(terrain, builds, trees, etc) will everything fits is there a way I can know how much memory I have left to see when I can use more VBO's or do I have to re-use the existing one and override the data?

  2. #2
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    20
    Yes, you can use VBOs for animation. Use GL_DYNAMIC_DRAW or GL_STREAM_DRAW. When data changes, write it using glBufferSubData or glMapBuffer. However you may wish to animate in a simpler way, such as by having every frame of animation stored in a large contiguous VBO, in to which you would offset.

    The only time you can combine objects' meshes into a single, larger mesh is when you know they will not translate / rotate / scale in relation to one another. This is because any transformations you apply to one vertex in the subset you intend to draw, will cause all other vertices to be thus transformed, as well. So a house might be combined into a terrain mesh, but a person certainly could not be combined into that same mesh, since they use different transformation matrices.
    Last edited by Nick Wiggill; 07-14-2012 at 04:41 AM.

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    15
    so do you think VBO with GL_DYNAMIC_DRAW or GL_STREAM_DRAW will still be faster than VA even when it will be constantly copying the mesh data, is it ok to create a VBO for every object on the scene?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •