Questions tagged [vbo]

A Buffer Object is an OpenGL object that allows users to store data on the GPU. Vertex Buffer Objects (VBOs) are buffer objects used to store vertex data for non-immediate-mode rendering.

VBOs offer substantial performance gains over immediate mode rendering primarily because the data resides in the video device memory rather than the system memory and so it can be rendered directly by the video device.

The Vertex Buffer Object specification has been standardized by the OpenGL Architecture Review Board as of OpenGL Version 1.5. Similar functionality was available before the standardization of VBOs via the Nvidia-created extension "Vertex Array Range"

Source: https://www.khronos.org/opengl/wiki/Vertex_Specification#Vertex_Buffer_Object

908 questions
143
votes
5 answers

What are Vertex Array Objects?

I am just starting to learn OpenGL today from this tutorial: http://openglbook.com/the-book/ I got to chapter 2, where I draw a triangle, and I understand everything except VAOs (is this acronym OK?). The tutorial has this code:…
Patrick
  • 1,894
  • 3
  • 15
  • 17
48
votes
2 answers

VBOs with std::vector

I've written a model loader in C++ an OpenGL. I've used std::vectors to store my vertex data, but now I want to pass it to glBufferData(), however the data types are wildly different. I want to know if there's a way to convert between std::vector to…
Bojangles
  • 99,427
  • 50
  • 170
  • 208
48
votes
2 answers

Use of Vertex Array Objects and Vertex Buffer Objects

I am trying to understand these two, how to use them and how they are related. Let's say I want to create a simple terrain and a textured cube. For both objects I have the array of triangles vertices and for the cube I have an array containing the…
ali
  • 10,927
  • 20
  • 89
  • 138
38
votes
5 answers

How to choose between GL_STREAM_DRAW or GL_DYNAMIC_DRAW?

I am using OpenGL ES 2.0, but I think it is also relevant to non-ES: how to know what "usage" to choose when creating a VBO? This particular VBO will be used for 1 to 4 times before completely updated, and I am not sure if I must pick GL_STREAM_DRAW…
lvella
  • 12,754
  • 11
  • 54
  • 106
36
votes
5 answers

When are VBOs faster than "simple" OpenGL primitives (glBegin())?

After many years of hearing about Vertex Buffer Objects (VBOs), I finally decided to experiment with them (my stuff isn't normally performance critical, obviously...) I'll describe my experiment below, but to make a long story short, I'm seeing…
Drew Hall
  • 28,429
  • 12
  • 61
  • 81
22
votes
1 answer

understanding glVertexAttribPointer?

private int vbo; private int ibo; vbo = glGenBuffers(); ibo = glGenBuffers(); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, Util.createFlippedBuffer(vertices), GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,…
user3256520
  • 441
  • 1
  • 4
  • 17
19
votes
1 answer

OpenGL is it better to batch draw or to have static VBOs

What is preferrable, from an effiency point of view (or another point of view if it's important) ? Situation An OpenGL application that draws many lines at different positions every frame (60 fps). Lets say there are 10 lines. Or 100 000 lines.…
mk12
  • 25,873
  • 32
  • 98
  • 137
18
votes
1 answer

Using an offset with VBOs in OpenGL

What I want to do is to render a mesh multiple times with the same vbo but with different offset. Example: //Load VBO glGenBuffers(2, &bufferObjects[0]); glBindBuffer(GL_ARRAY_BUFFER, bufferObjects[VERTEX_DATA]); glBufferData(GL_ARRAY_BUFFER,…
hidayat
  • 9,493
  • 13
  • 51
  • 66
17
votes
2 answers

OpenGL VBO updating data

I have to draw a buffer that holds a couple thousand vertices. I am using a vbo to store the data. I know I will have to update the VBO many times - but only in small parts at a time. So I am wondering what the best method to doing so is: Split VBO…
Pubby
  • 51,882
  • 13
  • 139
  • 180
17
votes
2 answers

Is using Vertex Buffer Object's for very dynamic data a good idea performance-wise?

I have many particles who's vertices change every frame. The vertices are currently being drawn using a vertex array in 'client' memory. What performance characteristics can I expect if I use a vertex buffer object? Since I have to use a number…
Ari Ronen
  • 2,222
  • 2
  • 22
  • 24
16
votes
3 answers

Is it possible to in-place resize VBOs?

The title says everything, but just to be clear I'll add some extra words. In this case, resize means: getting more storage space at the end of the old vbo saving the old data at the front (hopefully not copying, but at least not on CPU side,…
16
votes
1 answer

OpenGL, is it worth explicitly unbinding after a draw call?

It seems cleaner to me to unbind using glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0) and/or glBindBuffer(GL_ARRAY_BUFFER, 0) at the end of a given draw call. I like being sure that nothing is bound that should not be; however, is there much of a…
Engineer
  • 8,529
  • 7
  • 65
  • 105
14
votes
3 answers

Drawing multiple models using multiple openGL VBO's

rather than post lots of code, I will phrase this question intuitively. I hope you understand what I am getting at. I am making a game and in the code I have a model class that loads a model and sets up the VBO for it. In the loading function, it…
user3263338
  • 215
  • 1
  • 3
  • 6
13
votes
2 answers

The best way to use VBOs

What are the fastest and the most flexible (applicable in most situations) ways to use VBOs? I am developing an openGL application and i want it to get to the best performance, so i need someone to answer these questions. I read many questions and…
Qualphey
  • 1,244
  • 1
  • 19
  • 44
13
votes
1 answer

glEnableClientState deprecated

I want to use GL_POINT_SPRITE_ARB + VBO for my particle system rendering. I've done all preparations with point_sprites, but stuck at VBO. It seems that glEnableClientState, is not working. I read that it is deprecated in modern openGL. So, what…
user1575728
  • 131
  • 1
  • 1
  • 3
1
2 3
60 61