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 5 of 5

Thread: Question reguarding VBO's

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Location
    Dallas
    Posts
    12

    Question reguarding VBO's

    Ive been somewhat out of the loop of recent additions to the new OpenGL versions... 1.2 and later really, and I'm trying to get up to date. Ive got a lengthy math/graphics engine that is OpenGL based which I began in 1999.

    Maintainence of object data lists (vertex, normal, texture, index..etc) are all controlled by a large class that maintains any added objects in a scene. It also maintains a very large global vertex/index/normal list so that new objects are added via the maintainence class to the global list.

    To boost efficiency, I'd like to start using VBO's rather than maintaining such huge lists in client memory. Now, to me, its slightly unclear as to whether or not its possible to add/modify/remove objects from/in the VBO, and how access might be granted to it. It'd be redundant to keep a local copy of these lists, so they'd be "free"'d.

    Normally, most of the interaction with the global list only occurs at load time, loading models/meshes and such. However, if an object were to be added later in a scene, how would one go about adding the data to the lists? I couldnt see any clear facility in the specification of GL_ARB_vertex_buffer_object for adding/removing/modifying data or for resizing the lists as you would for C-type arrays, if its even possible.

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Question reguarding VBO's

    You can modify data with glBufferSubDataARB(), or you can map it with glMapBufferARB() and update the buffer through the returned pointer.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: Question reguarding VBO's

    If you load a new object, you should just create a new VBO, rather than attempting to resize them dynamically and so forth. Unless your objects are small, having multiple buffer objects is perfectly reasonable.

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2005
    Location
    Dallas
    Posts
    12

    Re: Question reguarding VBO's

    Ok, thats exactly what I was looking for. I didnt know if having multiple VBO's was something that wasnt good practice or not. About 90% of what is actually contained in the vertex lists is instantiated at load time. Everything else, normally small, is done on the fly.

    For instance rocket flares or any misc. transient objects not persistent throughout the simulation, would it be MORE of a performance hit to create multiple tiny VBO's or to just malloc/free the memory and use conventional glVertex/glNormal while reserving a very large VBO for complex underlying meshes and models?

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jul 2001
    Location
    France
    Posts
    1,749

    Re: Question reguarding VBO's

    VBO for dynamic draws are very fast, copying memory to them is very fast and take profit from AGP/PCI express. Immediate mode will never.

Posting Permissions

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