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

Swizzling Vertex Arrays, Vertex Buffer Objects and Shaders

I have a basic understanding of Vertex Arrays, Vertex Buffer Objects and Shaders. However, I am not sure if I can reuse them or whether the association is bijective. For example: Can I use the same Vertex Buffer Object in different Vertex Arrays?…
hanno
  • 6,034
  • 7
  • 42
  • 77
0
votes
2 answers

What is required to use Vertex Array Objects?

I am trying to use Vertex Array Objects in one of my programs, but it seems that my PC don't support this feature. When I execute this function glewIsSupported("GL_ARB_vertex_array_object"), it returns false. If I try to update my video driver,…
user1905910
  • 158
  • 1
  • 12
-1
votes
2 answers

VAO drawing the wrong Index Buffer

I'm trying to draw multiple objects with a (the same) basic shader program. The objects have vertex buffers that I intend to draw using associated index buffers by calling glDrawElements. I've set up a VAO for each object and thought I'd associated…
schwyzl
  • 134
  • 8
-1
votes
1 answer

Unexpected triangles rendered with OpenGL

I want to render blender's default cube and Suzanne. I have them both exported as OBJ-files. Loading and rendering works fine, but when I attempt to render them both in the same scene, things become confusing (to me). The "relevant" code is in lines…
elrat
  • 70
  • 5
-1
votes
1 answer

Does a Vertex Shader VAO need a VBO?

I am trying to use a VAO with a vertex shader. This works, but only if I set the length of the bufferData to 0. My understanding is that when using a vertex shader, a VBO is not required because my shader is generating the vertices of a quad. If I…
Jeshua Lacock
  • 4,342
  • 1
  • 24
  • 48
-1
votes
1 answer

Opengl - Triangle won't render?

I'm attempting to render a triangle using VBOs in OpenGL via C++. First, I identify my variables: CBuint _vao; CBuint _vbo; CBuint _ebo; struct Vertex { CBfloat position[3]; }; Then, I set the positions for each vertex to form a geometrical…
DrStrange
  • 64
  • 7
-1
votes
1 answer

OpenGL Red Book - If enums default to ints starting at 0, how does glBindVertexArray bind to the reserved value of 0?

I'm a bit confused on the first example of the OpenGL Programming Guide. The author uses this example: /////////////////////////////////////////////////////////////////////// // //…
johnjohn
  • 1
  • 1
-1
votes
1 answer

Configuring VAO to handle a VBO with multiple meshes

I'm trying to use a single VAO to represent a single VBO that contains multiple meshes. Right now I have: glVertexArrayElementBuffer ( vertexArray, buffer ); glVertexArrayVertexBuffer ( vertexArray, positionLocation, buffer, 0, 3 * sizeof (…
Stradigos
  • 673
  • 10
  • 25
-1
votes
1 answer

Cannot create more than one VAO

I am attempting to create a simple graphics system using modern (3.3) OpenGL for use in a game. Dynamic objects will have dynamic geometry and VBOs will be updated whenever there is a change. This part was very easy to implement. While everything…
user3736210
  • 63
  • 2
  • 7
-1
votes
1 answer

Why texture (GL_TEXTURE_2D) cannot work with (VertexArray) VAO

I am working on a project with openGL part. The scenegraph part is based on core OpenGL1.0 and still use glBegin and glEnd. Now I am adding new stuff on it and has to use VAO. I am a beginner and use QOpenGLFunctions_3_0 because I cannot find gl3.h…
-1
votes
1 answer

Moving, translating objects contained in vbo

I'm having trouble understanding how to actually translate a single object contained in a vbo. So first I set up vao and vbo and bind and enter vertices of a cube... glGenVertexArrays(1, &_vertexArray1); //Bind to first VAO …
OneTwo
  • 1,445
  • 5
  • 22
  • 45
-2
votes
1 answer

Do I need to call glEnableVertexAttribArray if I use VAOs?

I understood that VAOs can store bindings to VBOs and index VBOs (both GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER), but now I have a question: void render() { ..Set up textures, uniforms.. glBindVertexArray(vaoId)); // This also binds…
Dean
  • 5,226
  • 1
  • 24
  • 71
-2
votes
1 answer

Why is there the need for the index argument in glEnableVertexAttribArray?

Using glVertexAttribPointer the opengl implementation already knows to which attribute location/index in vertex shader Vertex Attribute Object is bound, so why is there the need to provide attribute index in glEnableVertexAttribArray again? I think…
Shuji
  • 574
  • 6
  • 22
-2
votes
1 answer

OpenGL crashing before it can render a frame - VBOs

After giving up on the slow glBegin/glEnd technique, I finally decided to use VBOs. After hours and hours of frustration, I finally got it to compile. But it doesn't mean it works. The function "CreateVBO" executes without errors, but as soon as…
CrizerPL
  • 277
  • 2
  • 10
-2
votes
1 answer

Opengl vao with ebo

I'm currently learning OpenGL in my free time and lately I have been facing an "error" I don't understand. The thing is, I have no errors, only nothing appear on my screen. I'm using OpenGL with SFML. Here is my code. Here is my method: void…
1 2 3
14
15