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
7
votes
2 answers

Using a VBO to draw lines from a vector of points in OpenGL

I have a simple OpenGL program which I am trying to utilize Vertex Buffer Objects for rendering instead of the old glBegin() - glEnd(). Basically the user clicks on the window indicating a starting point, and then presses a key to generate…
Aaron
  • 1,573
  • 3
  • 25
  • 38
7
votes
4 answers

Multiple meshes in one vertex buffer?

Do I need to use one vertex buffer per mesh, or can I store multiple meshes in one vertex buffer? If so, should I do it, and how would I do it?
Electro
  • 2,724
  • 4
  • 22
  • 32
6
votes
1 answer

Hard time understanding indices with glDrawElements

I'm trying to draw a terrain with GL_TRIANGLE_STRIP and glDrawElements but I'm having a really hard time understanding the indices thing behind glDrawElements... Here's what I have so far: void Terrain::GenerateVertexBufferObjects(float ox, float…
rfgamaral
  • 15,937
  • 49
  • 156
  • 269
6
votes
1 answer

Purpose of binding points in OpenGL?

I don't understand what the purpose is of binding points (such as GL_ARRAY_BUFFER) in OpenGL. To my understanding glGenBuffers() creates a sort of pointer to a vertex buffer object located somewhere within GPU memory. So: glGenBuffers(1,…
Jason
  • 1,867
  • 2
  • 18
  • 43
5
votes
1 answer

OpenGL: How to draw multiple line strips in one call?

I want to draw multiple line strips of different length. All vertices are in one common buffer. The order looks for example as follow: v_1_1,v_1_2,v_1_3,v_2_1,v_2_2,v_3_1,.. for each vertex v_i_j where i is the index of the strip and j the index of…
Matthias
  • 795
  • 1
  • 8
  • 19
5
votes
1 answer

How to properly update vertex buffers in DirectX 10

For a little background: I am working on a project in C++ in which I am trying to draw 3D representations of objects based on real time profile data. The profiling data is gathered from external profiling hardware. The system travels along an…
Tim Coolman
  • 595
  • 1
  • 9
  • 19
5
votes
2 answers

What is the difference between glVertexAttribDivisor and glVertexBindingDivisor?

I was looking for ways to associate attributes with arbitrary groupings of verticies, at first instancing appeared to be the only way for me to accomplish this, but then I stumbled up this question and this answer states : However what is possible…
Krupip
  • 3,570
  • 1
  • 27
  • 40
5
votes
0 answers

validateFunctionArguments:2800: failed assertion `(length - offset)(11088) must be >= 12368 at buffer binding at index 1 for scn_node[0].'

not sure what would be the best way to ask this question... But I have a scene kit scene with skinned human model (which consists of several skinned meshes, some have blend shapes (morphs), bone hierarchy and > 60 different materials). Some meshes…
Almakos
  • 91
  • 4
5
votes
2 answers

How to deallocate a MTLBuffer and MTLTexture

I know how to create a MTLBuffer and or MTLTexture but how do I free the GPU memory for these resources when they are no longer needed?
gloo
  • 2,018
  • 17
  • 35
5
votes
2 answers

Better to create new VBOs or just swap the data? (OpenGL)

So in a OpenGL rendering application, is it usually better to create and maintain a vertex buffer throughout the life of an application and just swap out the data every frame with glBufferData, or is it better to just delete the VBO and recreate it…
Xzhsh
  • 2,181
  • 2
  • 21
  • 30
5
votes
1 answer

How to dispose VBOs stored in a VAO

I am new to OpenGL, and am learning about VBOs and VAOs. I'm trying to understand how to dispose/free/detach VBOs in a VAO, when I don't have the single VBO ids anymore, only the VAO. Must I get all VBOs individually and then call glDeleteBuffers…
user3325226
  • 279
  • 1
  • 5
  • 10
5
votes
5 answers

How to cast int to const GLvoid*?

In my cross platform OpenGL application I want to draw using vertex buffer objects. However I run into problems invoking glDrawRangeElements. glDrawRangeElements(GL_TRIANGLES, start, start + count, count, GL_UNSIGNED_INT, …
LRaiz
  • 617
  • 6
  • 17
5
votes
2 answers

How to render a mesh made up of triangles where each triangle has same color without specifying that color 3 times per trianlge

How can I render a mesh (made up of triangles) where each triangle has same color without specifying that color 3 times per triangle in the vertex arrays. Suppose I want to draw 2 triangles. Triangle 1 : Vertex 1, position:(x1,y1) , color:…
viktorzeid
  • 1,361
  • 1
  • 16
  • 30
5
votes
2 answers

Why does OpenGL's glDrawArrays() fail with GL_INVALID_OPERATION under Core Profile 3.2, but not 3.3 or 4.2?

I have OpenGL rendering code calling glDrawArrays that works flawlessly when the OpenGL context is (automatically / implicitly obtained) 4.2 but fails consistently (GL_INVALID_OPERATION) with an explicitly requested OpenGL core context 3.2. (Shaders…
metaleap
  • 2,054
  • 2
  • 17
  • 37
5
votes
2 answers

How to specify buffer offset with PyOpenGL

What is the PyOpenGL equivalent of #define BUFFER_OFFSET(i) (reinterpret_cast(i)) glDrawElements(GL_TRIANGLE_STRIP, count, GL_UNSIGNED_SHORT, BUFFER_OFFSET(offset)) If the offset is 0, then glDrawElements(GL_TRIANGLE_STRIP, count,…
Johan Råde
  • 18,399
  • 19
  • 62
  • 103
1
2
3
20 21