Questions tagged [vao]

Vertex Array Object (VAO) is an OpenGL Object that encapsulates all of the state needed to specify vertex data. They define the format of the vertex data as well as the sources for the vertex arrays.

A Vertex Array Object (VAO) is an OpenGL Object that encapsulates all of the state needed to specify vertex data (with one minor exception noted below). They define the format of the vertex data as well as the sources for the vertex arrays. Note that VAOs do not contain the arrays themselves; the arrays are stored in Buffer Objects (see below). The VAOs simply reference already existing buffer objects.

Resources:

225 questions
4
votes
2 answers

VAOs and VBOs for rendering different objects

I wrote this "Model" class to load .obj files and allocate data for them in a VBO. Its code is something like this: (notice how it doesn't use VAOs) class Model {...} void Model::LoadOBJ(const char *file) { //load vertices, normals, UVs, and…
Pilpel
  • 2,931
  • 3
  • 25
  • 57
4
votes
1 answer

Crash on VAOs loaded from non-main thread

In my code I have a wrapper class for an object backed by two buffer objects and a vertex array object. I generate them using this in the constructor (slightly simplified): glGenVertexArrays(1, &vao); glBindVertexArray(vao); glGenBuffers(1,…
dascandy
  • 6,916
  • 1
  • 25
  • 49
3
votes
1 answer

Problem with rendering a quad in LWJGL 3 using VAOs and VBOs

(This is the second time I am asking this question. Last time I got one answer that didn't solve it (the answer there referred a bit of code that was left accidentally from one of my attempts at fixing this). I also changed the question itself…
Nitai99
  • 31
  • 2
3
votes
2 answers

How to draw multiple objects in OpenGL using multiple VAO and VBO?

I'm trying to render multiple objects in OpenGL using multiple VAO's and VBO's. To render multiple objects using the same vertices I've done it, but what I want to do is to use different vertices for each object, for example to draw a square and a…
s_diaconu
  • 119
  • 1
  • 8
3
votes
1 answer

WebGL 2.0: Draw call succeeds even VBO is deleted

So I am using a VAO to store pointers from a VBO. I wanted to test what happens when I delete my data buffers (vbo, ibo, etc.) before binding the VAO and calling a draw. Since VAOs store pointers to the data in the corresponding data buffers, I…
SuperTasche
  • 365
  • 1
  • 3
  • 13
3
votes
2 answers

Is the glVertexAttribPointer state bound to the current GL_ARRAY_BUFFER?

I have a simple question. Is it right, that glVertexAttribPointer operations have to be called once for a GL_ARRAY_BUFFER to save the attribute states until I want to change them? Or do I need to call glVertexAttribPointer each time in between…
bitQUAKE
  • 363
  • 1
  • 6
  • 18
3
votes
1 answer

What happens when binding a VAO without unbinding another bound VAO?

Suppose I have 2 different objects, each one has its own VAO and draw call. Something like this: void Object::Draw() { glBindVertexArray(vao); glDrawArrays(GL_TRIANGLES, foo, bar); } First I call the first object's draw call which binds its…
Jean Catanho
  • 227
  • 5
  • 17
3
votes
0 answers

Qt 5.9 OpenGL buffers cleanup

I recently updated to Qt 5.9. The application I'm working on uses QOpenGLWidget and QOpenGLBuffers. I noticed that since Qt 5.9, the QOpenglWidget destruction is really slow and makes the application exits really slowly. Any suggestions/ideas to…
M. Brigaud
  • 116
  • 6
3
votes
1 answer

Java lwjgl Modern OpenGL Access Violation Exception using VAOs

I am currently following ThinMatrix's OpenGL tutorial on rendering with VAOs and VBOS. I copy the code almost exactly (the only difference being I make a factory class static instead of just having it normally). The only technical difference I can…
echo_97
  • 43
  • 4
3
votes
1 answer

C++/OpenGL VAO Problems

#define GLEW_STATIC #include #include #include #include #include #include #include #define WIDTH 800 #define HEIGHT 600 #define TITLE "Dynamic" GLFWwindow* window; int…
Max
  • 197
  • 1
  • 7
3
votes
0 answers

PyOpenGL How to set VertexAttribPointer

I'm trying to build a Vertex Array Object in Python, following the tutorial on LearnOpenGL, and most of the code has been fairly easy to translate to Python with a bit of research, but I'm a bit stumped as to how I'm supposed to build a…
Matthew Fournier
  • 907
  • 2
  • 11
  • 31
3
votes
1 answer

OpenGL VAO VBO shaders confusion

I am writing a renderer and am at the point to pick a final way to handle vao/vbo/shader management. On the web I found highly contradictory information on what is actually recommended. Right now idea is as follow: -One VBO stores all meshes…
Teris
  • 560
  • 1
  • 7
  • 22
3
votes
2 answers

Do OpenGL Vertex Array Objects store vertex buffer names and indices, or only indices?

When created, do VAOs track just VBO indices (via glBindVertexBuffer), or also which VBO names are bound to those indices? If I specify a binding index of, say, 0 using glVertexAttribBinding during VAO creation, can I bind a different VBO to index…
jorgander
  • 540
  • 1
  • 4
  • 12
2
votes
1 answer

Draw multiple objects using VBOs with PyQt5 and OpenGL?

I am trying to render multiple objects in pyopengl using pyqt5. After following tutorials I created a 3D mesh which uploads a wavefront obj file and renders it with texture. This worked for me: class Model: def __init__(self, file_name,…
2
votes
1 answer

How to use glVertexAttrib3f with vao?

I use vao and vbo to draw a quad. A vertex shader has the following input: layout (location = 0) in vec3 pos I would like to use glVertexAttrib3f to set a constant pos value for the vertex shader. The following code has no effect (the quad is…
Irbis
  • 1,043
  • 4
  • 21
1
2
3
14 15