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
2 answers

Drawing multiple objects with shaders (GLEW)

I want to draw different figures using triangle fans but I am not sure how to make the program draw the second figure. Do I need a second vertexShaderSource and a second fragmentShaderSource each time I want to change the color or draw a new…
ICS
  • 87
  • 3
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,432
  • 1
  • 13
  • 39
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
1 answer

Updating bufferarray every frame OpenTK

I am drawing an object in OpenTK that keeps changing position in each frame. For now, I keep changing the position array and buffering the new data by calling GL.BufferData. Is there a way where I can update or map to one buffer array without making…
FATzz
  • 83
  • 5
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
  • 5
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,506
  • 10
  • 17
2
votes
1 answer

OpenGL 3.3 (mac) Error validating program: Validation Failed: No vertex array object bound

The following code compiles and runs without errors on linux but gives error "Error validating program: 'Validation Failed: No vertex array object bound." on mac OS 10.14.2 (Mojave). Note that the program compiles successfully but has a problem…
Satu0King
  • 147
  • 9
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
  • 2,028
  • 14
  • 20
2
votes
1 answer

Drawing a std::vector with glDrawElements

I'm trying to draw a terrain with the heightmap I have. By using std::vector, I now have an array of positions and an array of indices of the positions in order to use glDrawElements(GL_TRIANGLE_STRIP,...) when I draw the terrain. However, for some…
Peter
  • 460
  • 6
  • 23
2
votes
1 answer

How can I specify multiple UV coordinates for same vertexes with VAOs/VBOs?

I am in a situation where I would like to use VAO/VBO to recycle the same vertexes and use indexes to speed up rendering. All is fine, apart my textured models use UV coordinates and for the very same vertexes (approx >80%) I may end up having…
Emanuele
  • 1,408
  • 1
  • 15
  • 39
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
  • 7
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
  • 4
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…
user1204080
1 2
3
16 17