Questions tagged [vertex-attributes]

62 questions
0
votes
2 answers

How to have multiple storage layouts in one Vertex Array Object?

When I say storage layout, I mean what I define with glVertexAttribPointer. Is this state saved in the currently bound VAO or the buffer I bound to GL_ARRAY_BUFFER?
0
votes
1 answer

ERGMs on a network with twelve edge types

I have a rather complicated network. The network has 91 nodes and 3453 edges. There are twelve edge types. To build the network, I created 12 separate ego networks, using the edge attributes as individual nodes, then deleted the edge attribute…
Sez
  • 1
  • 2
0
votes
1 answer

OpenGL - Can't get shader to display vertex colors

So I finally set up opengl window properly and got triangles to show up using vaos, vbos and glDrawElements() etc. Here is the what i have But now I have new problem - can't get shaders to work. I don't quite understand them yet. I want fragment…
Splashman
  • 3
  • 1
0
votes
1 answer

GLSL: Data Distortion

I'm using OpenGL 3.3 GLSL 1.5 compatibility. I'm getting a strange problem with my vertex data. I'm trying to pass an index value to the fragment shader, but the value seems to change based on my camera position. This should be simple : I pass a…
0
votes
2 answers

If I do not explicitly bind the attributes using glVertexAttribPointer, what default locations will be used?

Refer to "Explicit vs Automatic attribute location binding for OpenGL shaders" If I do not explicitly bind the attributes using glVertexAttribPointer, what default locations will be used? Where can I find the official link for it?
user1914692
  • 2,823
  • 5
  • 33
  • 54
0
votes
1 answer

WebGL - which API to use?

I want to draw multiple polygon shapes (where each shape has it's own set of vertices). I want to be able to position these shapes independently of each other. Which API can i use to set the a_Position for the vertex shader? A) gl.vertexAttrib3f B)…
AlvinfromDiaspar
  • 5,868
  • 13
  • 63
  • 120
0
votes
1 answer

Possible bug while defining a vertex attribute

I'm getting a segmentation fault while trying to compile a vertex shader. I think I identified the problem in passing vertex attributes. The following lines compile (they might not work, but they still compile): # version 330 layout(location=0) in…
eaponte
  • 269
  • 4
  • 14
0
votes
1 answer

How to store a VBO in a custom object

I would like to store the vertex, normal, and texture information for my Cat objects within each instance in the form of a Vertex Buffer Object, but I don't know how. I want something like this: @property(nonatomic, assign) int *indices; // vertex…
michaelsnowden
  • 5,532
  • 2
  • 32
  • 72
0
votes
1 answer

Not able to get output with glDrawElements() & glMultiDrawElements()

I'm in the process of building a graphics app where the user can specify vertices by clicking on a canvas and then the vertices are used to draw polygons. The app supports line, triangle and polygon modes. Drawing a line and triangle is done by…
0
votes
1 answer

OpenGL: Why these codes draws nothing, with interleaved VBO and GLSL

I've looked many papers and blogs, and I finally reached these code to generate a quad: program stores in gProgram vert shader:--------------------- #version 330 layout(location = 0) in vec3 attrib_position; layout(location = 6) in…
Kee Pan
  • 5
  • 3
0
votes
0 answers

OpenGL ES on iOS What to set glVertexAttribPointer

I am having trouble setting up my OpenGL ES code. I am reasonably sure that my codes problem is where I set glVertexAttribPointer. Here is how I am inserting vertices and indices into their arrays: NSArray *verts = [JSONDictionary…
harryisaac
  • 1,041
  • 1
  • 9
  • 17
0
votes
1 answer

OpenGL - glVertexAttribPointer with multiple VBOs and VAOs using the same shader

I have multiple VBOs and matching VAOs set up in my rendering engine. I am a bit confused about using glVertexAttribPointer. I have set it and it renders fine but I am curious if I am using one shader (a basic diffuse) with all of these different…
Satchmo Brown
  • 1,357
  • 2
  • 19
  • 45
0
votes
2 answers

glDrawElements crashes when not using certain vertex attributes

In my OpenGL program I have two shaders. One renders with textures, and the other renders just solid colors. After compiling and linking a shader, I enable a texture coordinate vertex attribute array depending on weather or not the shader contains…
sFuller
  • 1,145
  • 2
  • 12
  • 23
0
votes
1 answer

Textured glDrawElement

I am having trouble getting my 3D model textured, I am just diving into 3D models as I have been using basic primitives for testing purposes and have been working on more engine specific code. I am however having trouble with the glDrawElements…
user1294021
  • 312
  • 3
  • 10
-1
votes
1 answer

Nvidia old driver, glDrawArrays Exception Access Violation

Our application crashes on old Nvidia drivers.. Debug code is here Looking around, here they say it is often due to an incorrect vertex attribute setup This is how I setup my vbo and vao: /** * Init Vbo/vao. */ …