Questions tagged [vertex-buffer]

A Vertex Buffer is an object that enables transmitting a collection of vertices to a graphics device for non-immediate or streaming rendering.

A Vertex Buffer is an object that enables transmitting a collection of vertices to a graphics device for non-immediate ot streaming rendering.

Examples are OpenGL's Vertex Buffer Object and Microsoft.XNA VertexBuffer class.

311 questions
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
  • 26,700
  • 10
  • 58
  • 79
18
votes
2 answers

OpenGL vertex buffer confusion

Would someone care to explain the difference to be between a VertexBuffer, a VertexArray, a VertexBufferObject, and a VertexArrayObject? I'm not even sure if these are all terms for different things, but I've seen all of them appear in the OpenGL…
Hannesh
  • 6,768
  • 6
  • 42
  • 77
16
votes
2 answers

OpenGL. Updating vertex buffer with glBufferData

I'm using OpenGL to implement some kind of batched drawing. For this I create a vertex buffer to store data. Note: this buffer generally will update on each frame, but will never decrease size (but still can increase). My question is: is it…
Celestis
  • 513
  • 1
  • 4
  • 10
14
votes
2 answers

Does interleaving in VBOs speed up performance when using VAOs

You usually get a speed up when you use interleaved VBOs instead of using multiple VBOs. Is this also valid when using VAOs? Because it's much more convenient to have a VBO for the positions, and one for the normals etc. And you can use one VBO in…
Merni
  • 2,473
  • 5
  • 30
  • 40
14
votes
1 answer

Updating vertex data in a VBO (glBufferSubData vs glMapBuffer)

I want to update an object's list of vertices after a VBO has been created. I've seen both glBufferSubData and glMapBuffer and they both appear to do similar things, which means I'm now unsure which one to use. My pseudo workflow is: Create object …
Mark Ingram
  • 65,792
  • 48
  • 164
  • 225
12
votes
2 answers

OpenGL default value for unbuffered vertex attribute when using layout qualifiers

I'm assuming this will be one of those things that is "undefined", but I can't seem to find a concrete answer from google. Let's say in my vertex shader I have: layout(location = 0) in vec3 vPosition; layout(location = 1) in vec3…
kbirk
  • 3,687
  • 5
  • 38
  • 66
12
votes
2 answers

C++: OpenGL, glm and struct padding

can I safely use the glm::* types (e.g. vec4, mat4) to fill a vertex buffer object ? std::vector vertices; glBufferData(GL_ARRAY_BUFFER, sizeof(glm::vec3) * vertices.size(), &vertices[0], GL_STATIC_DRAW); I'm not quite sure about…
Kr0e
  • 2,009
  • 2
  • 21
  • 37
11
votes
1 answer

GLES2 Is glBindAttribLocation() Necessary?

This might be a noob question. As I understand it, glBindAttribLocation(..., AAA, ...) will bind an attribute within the program to the location ID of AAA, as long as AAA is unique. If I have the following code: glBindAttribLocation(..., 0,…
MarkP
  • 3,868
  • 9
  • 39
  • 76
11
votes
2 answers

How do I properly update a vertex array in OpenGL Es 2.0?

When I update my vertex array on iOS in OpenGL 2.0, the original vertex data is staying on the screen -- ie the 1st flush is persistent (the initial set of points I sent down to the GPU gets rendered every frame), but the 2nd, 3rd, 4th, .. nth…
bobobobo
  • 57,855
  • 58
  • 238
  • 337
10
votes
1 answer

How to get VBOs to work with Python and PyOpenGL

The following Python program should draw a white triangle in the upper right quadrant of the window. import pygame from OpenGL.GL import * from ctypes import * pygame.init () screen = pygame.display.set_mode ((800,600),…
broepi
  • 191
  • 1
  • 7
10
votes
1 answer

How does VAO keep buffer bindings?

I am struggling to understand how exactly VAO is handling buffer mapping. What I'm doing could be described in this pseudocode: SetUp: BindVAO BindArrayBuffer glBufferData(GL_ARRAY_BUFFER, ExpectedMaxCount, NULL, GL_DYNAMIC_DRAW);//Allocate…
Kimi
  • 11,963
  • 7
  • 49
  • 79
9
votes
1 answer

Problem with degenerate triangles and GL_TRIANGLE_STRIP

I'm trying to draw multiple triangle strips with only one call to glDrawElements and my research on the matter tells me I need to use degenerate triangles. Maybe my understanding on the subject is wrong but I thought this should allow me to "jump"…
rfgamaral
  • 15,937
  • 49
  • 156
  • 269
9
votes
1 answer

Vertex Array Objects - Confusion regarding exactly what state information is saved about the currently bound vertex buffer

I'm working through the excellent tutorials at arcsynthesis while building a graphics engine and have discovered I don't understand VAOs as much as I thought I had. From the tutorial Chapter 5. Objects In Depth Buffer Binding and Attribute…
Peter Clark
  • 2,521
  • 2
  • 19
  • 35
8
votes
1 answer

OpenGL ES 2.0 and vertex buffer objects (VBO)

I can't figure out how to use a vertex buffer object for my terrain in opengl es 2.0 for iphone. It's static data so I'm hoping for a speed boost by using VBO. In regular OpenGL, I use display lists along with shaders no problem. However, in opengl…
Nitrex88
  • 2,132
  • 2
  • 20
  • 23
7
votes
1 answer

OpenGL Vertex buffer object, can I access the vertex data for other uses such as collision detection?

I'm currently using the GLTools classes that come along with the Superbible 5th edition. I'm looking in the GLTriangleBatch class and it has the following code: // Create the master vertex array object glGenVertexArrays(1,…
kbirk
  • 3,687
  • 5
  • 38
  • 66
1
2 3
20 21