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:

242 questions
2
votes
1 answer

Retrieve number of VBOs linked to a VAO and their ids only with VAO id, is it possible?

Environment: OpenGL 3.3+, C programming, Windows. I have a function that loads all vertex data from a model but only return the VAO id and number of vertex. In the process it generates the VBO ids and vertex arrays data is passed to the buffer...…
Ray
  • 123
  • 2
  • 9
2
votes
2 answers

glDrawElements throw GL_INVALID_VALUE error

I am trying to draw part of my tile image but I am getting GL_INVALID_VALUE error when I call glDrawElements function. There is no problem when I change this function with glDrawArrays. The problem is that the indices count parameter is not negative…
2
votes
2 answers

Binding to GL_ELEMENT_ARRAY_BUFFER with no VAO bound

The buffer currently bound to the GL_ELEMENT_ARRAY_BUFFER target in OpenGL is part of the state contained in a Vertex Array Object (VAO from here on). According to the OpenGL 4.4 core profile spec then, it would seem that attempting to change or…
bcrist
  • 1,520
  • 13
  • 25
2
votes
1 answer

OpenGL instanced arrays strange vertex positions

I am having troubles getting the correct output from my OpenGL application after switching from normal drawing with VBOs/VAOs to instanced arrays with VBOs/VAOs. The output is supposed to be a bunch of spheres, but instead it's crazy positioned…
Zhivko Bogdanov
  • 241
  • 4
  • 10
2
votes
1 answer

Opengl Vertex Array Objects

Are OpenGL's Vertex Array Objects stored in VRam? What I'm really asking: If I load a model, using Assimp for example, then read the vertex and indice data into Vertex Array Objects; will I be duplicating data in Ram, or copying it to the GPU?
Ignoreme
  • 193
  • 1
  • 2
  • 11
1
vote
0 answers

Accessing vertex buffer object (VBO) with CUDA

I've been trying to implement a particle simulation engine which computes forces between particles on GPU using CUDA and visualizes it using openGL. I've been stuck for some time on the part where I want to update my vertex buffer without copying it…
CantDoMath
  • 21
  • 3
1
vote
0 answers

OpenGL Cube w/ Python pyopengl

I am writing a opengl application that renders a simple green colored cube, but unfortunately it does not. So far the project consists of a camera and obviously, the cube. I do not think the underlying problem is the camera as the projection does…
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
1 answer

How do OpenGL buffers relate to the VAO?

I'm currently learning OpenGL, but I'm having some problems understanding how the different buffers relate to the VAO. In my following code, I'm creating one VAO and two buffers (VBO for the vertex positions and EBO for the vertex order). At this…
1
vote
1 answer

How to create a 2d grid in OpenGl windows?

I am trying to print a 2d grid on my entire window. code: float slices(15); std::vector vert; std::vector ind; for (int j = 0; j <= slices; j++) { for (int i = 0; i <= slices; i++) { GLfloat x = (float)i /…
KADAL.212
  • 13
  • 4
1
vote
0 answers

I don't understand how glGenVertexArrays and glBindVertexArray works

This small piece of code makes me confused. GLuint VAO; glGenVertexArrays(1, &VAO); glBindVertexArray(VAO); From what I know, glGenVertexArrays generates 1 name/ID and stores it into the variable VAO. What I don't understand is when I use the…
1
vote
1 answer

ARRAY_BUFFER lost after VAO binded to null in WebGL

I created a VAO and bound the VBOs for the VAO to remember those bindings: bufferV = gl.createBuffer (); bufferI = gl.createBuffer (); vertexArray = gl.createVertexArray (); gl.bindVertexArray (vertexArray); gl.bindBuffer (gl.ELEMENT_ARRAY_BUFFER,…
StashOfCode
  • 83
  • 1
  • 6
1
vote
1 answer

PyOpenGL glDeleteBuffers and glDeleteVertexArrays produces an error

When calling glDeleteVertexArrays(1, vao_id) or glDeleteBuffers(1, vbo_id) produces a type error: Traceback (most recent call last): File "C:\Users\Ollie\AppData\Local\Programs\Python\Python39\lib\site-packages\OpenGL\latebind.py", line 43, in…
Egg42
  • 65
  • 5
1
vote
1 answer

what is the correct way to use glBindAttribLocation()?

I have been trying to learn OpenGL recently. I am a quite confused on the correct usage of glBindAttribLocation because I thought that it sets attributes in the shader(such as in vec3 position;) to data in the VAO (for example attribute 0 in the…
Egg42
  • 65
  • 5