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.

329 questions
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,158
  • 2
  • 21
  • 23
8
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
  • 4,404
  • 2
  • 32
  • 54
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,906
  • 7
  • 48
  • 72
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,693
  • 4
  • 26
  • 40
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,994
  • 5
  • 26
  • 32
6
votes
0 answers

Interleaved vs non-interleaved vertex buffers

This seems like a question which has been answered throughout time for one IHV or another but recently I have have been trying to come to a consensus about vertex layouts and the best practices for a modern renderer across all IHVs and…
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
  • 16,546
  • 57
  • 163
  • 275
6
votes
2 answers

OpenGL GLSL Send color as integer to shader to be decomposed as vec4 RGBA

I can send color to shader as 4 floats - no problem. However I want to send it as integer (or unsigned integer, doesn't really matter, what matters is 32 bits) and be decomposed in vec4 on shader. I'm using OpenTK as C# wrapper for OpenGL (although…
chainerlt
  • 215
  • 3
  • 8
6
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
  • 667
  • 7
  • 18
6
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
  • 20,480
  • 21
  • 73
  • 110
6
votes
2 answers

How to use glBufferData() in PyOpenGL?

How do you use glBufferData() in the PyOpenGL python bindings to OpenGL? When I run the following code import sys from OpenGL.GL import * from PySide.QtCore import * from PySide.QtGui import * from PySide.QtOpenGL import * class…
Johan Råde
  • 20,480
  • 21
  • 73
  • 110
5
votes
1 answer

Passing unsigned int input attribute to vertex shader

In a typical building of a vertex-array-buffer, I am trying to pass an unsigned int attribute along side other classical ones (vertex, normal, texture coordinates...). However the value of this attribute ends up somehow wrong: I am unsure whether…
Smoove
  • 163
  • 9
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
  • 1,055
  • 2
  • 14
  • 26
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
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
1
2
3
21 22