Questions tagged [vertex-array-object]

Vertex array objects are OpenGL container objects that hold the state needed to describe vertex array data for rendering. They store references to any buffer objects needed to use as vertex array source data.

70 questions
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 can't update vertex buffer with VAO procedure

I'm attempting to move a vertex by modifying it's positional vertex attribute. As a test, I have added the line vertices[0] = 0.4f; both before and after the creation of my VAO procedure, to see whether I am able to modify the vertices array after…
MattyAB
  • 365
  • 2
  • 9
  • 19
2
votes
0 answers

OpenGL Vertex Array Object failing to bind Vertex Buffer

I am learning OpenGL through https://learnopengl.com/. From that site, and my research on the internet while trying to solve this problem, I have learned that Vertex Array Objects are useful because you can bind one with glBindVertexArray, and Any…
phil
  • 1,416
  • 2
  • 13
  • 22
2
votes
2 answers

Unable to obtain buffer object data through glGetBufferSubData

I was hoping to make a tower of hanoi game using opengl. Eventually i came up to the problem of processing & transfering data from one buffer object to another. I have successfully stored my vertices in a buffer object and bound it with a vertex…
2
votes
0 answers

OpenGL VAO + multiple VBO - theory - batch render

I'm thinking about tweaking my current batch render. What I currently do is run a loop with command like this : shader->setUniformValue("mvp_matrix", matrix * geo[x].geoMatrix); glDrawElementsBaseVertex(GL_TRIANGLES, meshIndicesCountList[x],…
2
votes
1 answer

OpenGL big projects, VAO-s and more

So I've been learning OpenGL 3.3 on https://open.gl/ and I got really confused about some stuff. VAO-s. By my understanding they are used to store the glVertexAttribPointer calls. VBO-s. They store vertecies. So if I am making something with…
Rokner
  • 169
  • 2
  • 13
2
votes
2 answers

Interleaved Vertex Array Object doesn't show colors

I am trying to render a bunch of vertices with an own color for each vertex. The number of vertices is around 1 mio, so I use a Vertex Array Object to render them. It's no problem for me to render the points, but when I add the colors to the data…
Schamote
  • 47
  • 7
1
vote
1 answer

Why is my code not displaying on phone emulator with vertex array object in opengl

I'm new to this but what I'm trying to do is using vertex array object to display something on a phone emulator. But the problem is that it isn't displaying anything on the phone. What I have understood of using vertex array objects is that a VAO is…
apo
  • 43
  • 4
1
vote
1 answer

How to refactor code from Vertex Array to Vertex Array Object methods

I'm studying Opengl and the book i've been using is OpenGL(R) ES 3.0 Programming Guide, 2nd Edition. And at chapter 6 they talk about Vertex arrays and they have a example code that uses Vertex Array methods, which is the code below. Later down that…
apo
  • 43
  • 4
1
vote
0 answers

Why do I get an 'invalid operation error' when I use glGenVertexArrays() in PyOpenGL eventhough I am creating an OpenGL 4.1 context?

I'm trying to write a simple program to display an icosahedron using PyOpenGL but I can't get past generating the VAO. The problem is not solved in glGenVertexArrays Mac OSX PyOpenGL as I am creating an OpenGL 4.1 context. I always get the following…
bresslem
  • 11
  • 2
1
vote
1 answer

OpenGL program doesn't show a triangle

I am following a tutorial on OpenGL in C++ and for some reason the exact same code doesn't work for me. It is supposed to display a triangle, but it doesn't show anything.Just a blank screen. Here is the code: #include #define…
Martin Chekurov
  • 733
  • 4
  • 15
1
vote
1 answer

OpenGL VBO with single float per Vertex problem

I have been stuck all day yesterday with this problem and cant figure it out. The code is below but generally i am trying to give a mesh Vertex Attributes for 1.Postions 2.Indices 3.Normals and 4.a single float value. The values are all stored in…
Alexander W
  • 55
  • 1
  • 5
1
vote
1 answer

Can't seem to get a VAO to render... Can someone help me see what I did wrong?

So an interesting thing about this problem is, I tried to use RenderDoc but RenderDoc crashed when I tried to load a frame I captured, this happened every time I tried, so it would seem graphics debugging tools wont help me in this situation... I am…
1
vote
1 answer

Confusion about binding the index of a non-existent attribute using glVertexAttribPointer

When binding an attribute index using glVertexAttribPointer, what happens when an associated program does not contain an attribute at said index? Is the behaviour undefined, or is the attribute ignored altogether? I have searched the docs quite…
1
vote
1 answer

Inconsistent behavior in instance rendering with glDrawElementsInstanced, somtimes no rendering with no errors

I've been working on project using OpenGL. Particles are rendered using instanced draw calls. The issue is that sometimes glDrawElementsInstanced will not render anything. And no errors are reported. Other models and effects render fine. But no…