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
2
votes
1 answer

OpenGL GLFW, triangle not rendering

I've been trying to render a triangle on macOS but it doesn't work. Here is my code: #include #include #include #include void OnError(int errorCode, const char* msg){ throw…
Theelf111
  • 23
  • 4
2
votes
1 answer

Can I set VAO before VBO in OpenGL?

I have a Sphere class that generate the VBO for creating given input radius and some more parameters. Each Sphere VBO share the same memory layout (let's say vertex indice 0 = vertices, 1 = colors). I may getting wrong, but if a understand…
rafoo
  • 1,147
  • 7
  • 13
2
votes
1 answer

Why does Vertex Array Object cause an error?

I have a opengl-program that works... Until I try to use a Vertex Array Object. I have tried to change the code back and forth for days now but cannot find where the problem lies. This is part of the code. glCall(...) is a helper function for error…
Lasersköld
  • 996
  • 5
  • 10
2
votes
1 answer

Render one VAO containing two VBOs

I'm trying to draw two triangles in a window in OpenGL 3.3. I'm using the GLFW library for the windowing system. From what I understand, I should have two VBOs (one for each triangle) and one VAO containing these two VBOs. That's what I…
GuiTeK
  • 1,156
  • 3
  • 14
  • 34
2
votes
1 answer

GL_ARB_vertex_attrib_binding and indexed drawing

I'm experimenting with rendering a Minecraft-like world in OpenGL. The world is split into chunks (each of them containing N^3 blocks) and these chunks get rendered each frame. Currently I'm using one VAO per chunk. I always thought this is a bit…
yzsolt
  • 23
  • 3
2
votes
1 answer

C++/OpenGL: VAOs work individually but not together

Trying to implement a basic example of VAOs using C++/OpenGL and I've come across a peculiar problem that I have not found a solution for after searching for a while. My program is supposed to render a texture (CT image) to a square and then draw…
stevend12
  • 75
  • 6
2
votes
0 answers

Cannot Create VAO in LWJGL3

Whenever i try to populate a VAO, i get a null pointer exception Error Hello LWJGL 3.0.0a! 2.1 INTEL-10.0.86 Exception in thread "main" java.lang.NullPointerException at org.lwjgl.opengl.GL30.nglGenVertexArrays(GL30.java:3265) at…
bay jose
  • 21
  • 3
2
votes
2 answers

VertexArrayObject, how can i set "default" attribute value?

I'm developing an OpenGL application and I'm trying to make ShaderPrograms and VAO's independent of each other. Saying independent I mean that both ShaderProgram and VAO can have different set of attributes. While creating new ShaderProgram I…
xorza
  • 1,574
  • 1
  • 11
  • 15
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
  • 1
  • 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

What are the Attribute locations for fixed function pipeline in OpenGL 4.0++ core profile?

I would like to know the attribute locations inside fixed pipeline (no shader attached) for nVidia OpenGL drivers: glVertex = 0 glColor = 3 glNormal = ? glTexCoord = ? glMultiTexCoord 0..7 = ? glSecondaryColor = ? glFog = ? Empirically I found the…
Spektre
  • 41,942
  • 8
  • 91
  • 312
2
votes
1 answer

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,490
  • 13
  • 24
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
  • 9
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
1 answer

In OpenGL, how to pick an object by name stack when I use the VAO to draw objects?

I'm dealing with an old large project using fixed rendering pipeline, and the current project used the name stack to pick an object. Now I need to change one object in the project to the VAO (glDrawElements...) mode, while the other objects remain…
Ray
  • 61
  • 2
1 2
3
14 15