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?
![](../../users/profiles/4246148.webp)
mak
- 225
- 4
- 11
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…
![](../../users/profiles/5399951.webp)
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…
![](../../users/profiles/4700490.webp)
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…
![](../../users/profiles/2174719.webp)
Jordan J Hiebert
- 59
- 10
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?
![](../../users/profiles/1914692.webp)
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)…
![](../../users/profiles/158103.webp)
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…
![](../../users/profiles/1302145.webp)
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…
![](../../users/profiles/2770572.webp)
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…
![](../../users/profiles/2728073.webp)
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…
![](../../users/profiles/1795671.webp)
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…
![](../../users/profiles/732271.webp)
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…
![](../../users/profiles/594760.webp)
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…
![](../../users/profiles/1294021.webp)
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.
*/
…
![](../../users/profiles/1047713.webp)
elect
- 5,677
- 9
- 44
- 97