Questions tagged [index-buffer]

The index buffer contains integers, three for each shape in a mesh of structures, which reference the various attribute buffers (position, color, UV coordinates, other UV coordinates, normal, …).

The index buffer contains integers, three for each shape in a mesh of structures, which reference the various attribute buffers (position, color, UV coordinates, other UV coordinates, normal, …).

39 questions
10
votes
1 answer

Map/Fold the multiple .OBJ-index-buffers to OpenGL's 1 index buffer

I am trying to load in a .obj-File and draw it with the help of glDrawElements. Now, with glDrawArrays everything works perfectly, but it is - of course - inefficient. The problem I have right now is, that an .obj-file uses multiple index-buffers…
user4063815
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
3
votes
1 answer

Can I glDeleteBuffer a VBO and IBO after binding to a VAO?

I've read that a VBO (Vertex Buffer Object) essentially keeps a reference count, so that if the VBO's name is given to glDeleteBuffers(), it isn't truly dismissed if a living VAO (Vertex Array Object) still references it. This behavior is similar…
Anne Quinn
  • 12,609
  • 8
  • 54
  • 101
3
votes
1 answer

How are tripled sequence in IBO working?

I'm analyzing an obfuscated OpenGL application. I want to generate a .obj file that describes the multi-polygon model which is displayed in the application. So I froze the app and dig out the values set in VBO and IBO. But the values set in IBO was…
Izumi Kawashima
  • 1,197
  • 11
  • 25
3
votes
2 answers

OpenGL - auto generation of indices / stride parameter for glDrawArrays

I'm rendering a grid-structure with lots of data-points (>1M). The structure of my data is in the picture. So the content of my index buffer looks like this 0, 100, 1, 101, 2, 102, 3, 103, ... I'm a bit annoyed by the huge size of my index-buffer…
freakinpenguin
  • 831
  • 14
  • 24
2
votes
1 answer

Why should I bind the index buffer to draw elements with a VAO?

I use the following code to render a simple quad using a vertex array and an index buffer. In the Vertex specification, I see The index buffer binding is stored within the VAO. But in my code, in the render loop, I need to bind the index buffer to…
Syscall
  • 19,327
  • 10
  • 37
  • 52
2
votes
1 answer

OpenGL Index Buffer Object element order incorrectly drawn

Notice how my program draws a single triangle, but instead what I am trying to express in code is to draw a square. My tri_indicies index buffer object I believe correctly orders these elements such that a square should be drawn, but when executing…
greg
  • 1,118
  • 1
  • 20
  • 40
2
votes
0 answers

WebGL trouble using an index buffer to draw a sphere mesh using an offset

I am trying to draw a sphere mesh that I can later modify to look like the leaves of a tree. However, there are also vertices in my pointsArray that precede those generated from my sphere mesh. I have an index buffer containing the indices for…
M. Rosenlof
  • 112
  • 8
2
votes
1 answer

How to restore CCW winding order after reflecting vertices in the x or y axis?

I'm rendering a polygon in OpenGL with a vertex array called vertices and a final index buffer called DRAW_ORDER with CCW winding. I have back-face culling enabled, and I make draw calls using glDrawElements(GL_TRIANGLES, DRAW_ORDER.capacity(),…
William
  • 111
  • 2
  • 5
2
votes
1 answer

Calculate Index-buffer size of a cube

I've been following a Computer Graphics course for a few weeks with an exam coming up, however I've gotten stuck on the topic of index buffers. I know that a vertex buffer stores all vertices of a mesh. Now suppose we wish to make a cube. This means…
CoderApprentice
  • 425
  • 1
  • 6
  • 21
1
vote
1 answer

Drawing two triangles using index buffer

I am following Cherno's brilliant series on OpenGL, and I have encountered a problem. I have moved on from using a vertex buffer only, to now using a vertex buffer together with an index buffer. What I want to happen, is for my program to draw two…
Henrik Hillestad Løvold
  • 1,213
  • 4
  • 20
  • 46
1
vote
1 answer

Use one Vertex Buffer Object for glDrawArrays (ignoring IBO) and glDrawElements (with an IBO)

I've got a Vertex Buffer Object (VBO) that I typically use (with an appropriate VAO) to draw points with lines between them via two calls to glDrawArrays (one with GL_POINTS and one with GL_LINE_STRIP). Now I'm interested in ditching the…
FTLPhysicsGuy
  • 1,035
  • 1
  • 11
  • 23
1
vote
1 answer

In a GLSL vertex shader can you access the index of a vertex in the index buffer, not just the vertex buffer?

I am rendering a primitive in Vulkan which has repeated vertices which are processed differently by the vertex shader depending on their index in the vertex buffer. All repeated vertices are consecutive, so if a, b, c are vertices the buffer might…
Oliver
  • 1,576
  • 1
  • 17
  • 31
1
vote
1 answer

Render several graphs from single vertex buffer

I have a vertex buffer containing several (in this case 2) graphs in the following structure: var vertices = [ x0, y00, y10, x1, y01, y11, x2, y02, y12, ... xn, y0n, y1n ]; and its indices var indices = [0, 1, 2, 3, ... n-1]; You can…
ampawd
  • 968
  • 8
  • 26
1
vote
0 answers

Creating 3d Ring in Android/Openegl with index buffer Objects

Right now im Creating an 3D game for android/OpenGL the sence is to fly through such 3D Rings made with index Buffer Objects as shown in the pictures. My Problem: Actually my twisted Loop is generating the Coordinates like it should but if i…
Thomas
  • 11
  • 2
1
2 3