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: VAO & VBO help!

  1. #1

    Post VAO & VBO help!

    Hi guys,

    This may sound like a stupid question, but here goes; I have a single VAO and single VBO in my renderer. Right now when I wish to draw my primitives I update the VBO data and push to the GPU for shaders.

    Am I able to use only one VBO? It seems the only object that renders on the screen is the last update made to the VBO. This leads me to believe that I should have multiple VBOs.

    Would it be best for me to create a new VBO whenever that data needs to be updated and then have the code check if that VBO exists already otherwise create a new one?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,106
    I depends on how you render objects. A draw call will render the current content of the vbo so if you use a sequence like

    modify vbo
    draw vbo
    modify vbo
    draw vbo
    swap buffer

    you will be able to draw 2 objects with one vbo.

    Normally you use multiple vbo/vao sets. At least 1 for static objects and 1 for each object whose vertices you modify.

  3. #3
    We currently do handle rendering that way, update/draw all objects and then swap the buffers, however it doesn't seem to be behaving that way and only renders the last set of data sent.

Posting Permissions

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