Questions tagged [vertex-array-object]

Vertex array objects are OpenGL container objects that hold the state needed to describe vertex array data for rendering. They store references to any buffer objects needed to use as vertex array source data.

64 questions
1
vote
1 answer

Cannot Read Values Passed to Vertex Shader

I am trying to wrap my head around the various types of GLSL shaders in OpenGL. At the moment I am struggling with a 2d layered-tile implementation. For some reason the int values that get passed into my shader are always 0 (or more likely, null). I…
1
vote
2 answers

Get old style OpenGL code work in GLSL

I am trying to draw this pattern in OpenGL : To get this, I created the pattern like : vector< vector > datas; float Intensitytemp=0; float xPos=0, yPos=0, angleInRadians=0; for (float theta = 0.0f; theta < 4096; theta += 1.f) { …
Muhammet Ali Asan
  • 1,258
  • 20
  • 35
1
vote
2 answers

Binding multiple buffer object with a single vertex array object is not working

I'm trying to understand the mapping between OpenGL vertex buffer binding points and vertex array indices. I have a 2D rectangle and a 2D triangle const GLfloat rect[] = { -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, -0.5f,…
Samik
  • 495
  • 1
  • 7
  • 17
1
vote
1 answer

Issue with glGenVertexArrays and glGenVertexBuffers when drawing several cubes

I have written a small program that is supposed to display several cubes with OpenGL 4.3. I use SDL 2.0 to create a context but I don't think my problem comes from there. I have a class Cube that has several attributes, including a GLuint m_vao for…
Sunreef
  • 3,879
  • 14
  • 31
1
vote
1 answer

Call to glBindVertexArray(vao): what does it do if 'vao' is already bound, and how to design shape classes accordingly?

I am trying out OpenGL again and I'm wondering how to design the classes that are rendered later on. Right now, there's is only one type of shapes, and so I created a class Shape with a static VAO member that glGenVertexArrays(1, &vao) is called on…
InvisiblePanda
  • 1,519
  • 1
  • 16
  • 37
1
vote
1 answer

Haskell opengl attrib is not active

I am trying to render some data from a vertex buffer object. However with little using glutil and raw. When the program runs it is stuck in a infinite loop and I get the errors that you see down below. vertex shader #version 150 core in vec4…
1
vote
1 answer

OpenGL ES Vertex Array Object and strange artifacts

I am rendering a scene that has to get rebuilt whenever there is an orientation change in order to fill the screen appropriately. The scene renders a few vertex array objects of regular colored quads and an array of textured vertex array objects. …
dragonflyesque
  • 485
  • 5
  • 11
0
votes
1 answer

update vertices and indices in OPENGL

hi everyone I new to OPENGL and I want to update the vertices and indices when I translate the 3d object I make vertices vector and indices vector these vector hold all the data of the 3d object is this possible the code I use : // Create…
0
votes
1 answer

Using multiple VBO in a VAO

I try to use 2 VBO inside a VAO and I end up with a crash (far beyond my app). The idea is to make a first VBO (and optionnally an IBO) to stucture the geometry. This worked well, until I get the idea to add a second VBO for the model matrix as a…
0
votes
1 answer

When drawing multiple objects, when do you create a new vertex array object?

I'm trying to create a game with WebGL. I currently have three textures, one with letters for the font, a sprite sheet for the character, and a tilemap for the world. So I have a few large textures and I need to draw a small part of them multiple…
user1801359
  • 251
  • 1
  • 2
  • 9
0
votes
1 answer

OpenGL Draw Multiple Vertex Arrays

I want to draw multiple vertex arrays. This is the initialization: unsigned int va1; unsigned int vb1; void init_va1() { glGenVertexArrays(1, &va1); glBindVertexArray(va1); glGenBuffers(1, &vb1); glBindBuffer(GL_ARRAY_BUFFER, vb1); …
Ababwa
  • 81
  • 4
0
votes
0 answers

Is this GLSL mat4 vertex attribute being set up correctly?

I am using this vertex information as input to a GL_POINTS geometry shader. struct Vertex { glm::mat4 transform; glm::vec3 colour; }; Vertex points [] = {...}; When setting up the colour attribute, the following code works (with m_location…
spraff
  • 29,265
  • 19
  • 105
  • 197
0
votes
1 answer

My OpenGL Vertex Array no longer works when abstracted out into a class

I am using OpenGL to render some cubes and I have managed to get around 10 cubes rendering however I now want to abstract the code out into classes. I have started with the vertex array object. I have looked through the code and followed it through…
0
votes
1 answer

glBindVertexArray does not switch VAO in display() but does in init()

I am trying to learn how to program OpenGL. Right now I am writing a program that draws to cubes. I have each cube stored in a separate VBO. This is the code for this. void init() { enum { Vertices, Colors, Elements, NumVBOs }; GLuint…
user3834551
0
votes
1 answer

Is it possible to use Vertex Array Objects on Raspberry Pi?

Is it possible to use Vertex Array Objects on Raspberry Pi? Can I load it as extension?