Questions tagged [vertex-attributes]

73 questions
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
  • 3,033
  • 5
  • 36
  • 61
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
  • 409
  • 5
  • 15
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
  • 6,031
  • 2
  • 38
  • 83
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,121
  • 1
  • 10
  • 18
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,409
  • 2
  • 20
  • 47
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,305
  • 2
  • 14
  • 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
  • 322
  • 3
  • 11
-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. */ …
elect
  • 6,765
  • 10
  • 53
  • 119
-3
votes
1 answer

Why does the rendered object appear distorted?

I'm getting a distorted red triangle when trying to display a red triangle with 3 vertices (at (-0.5,-0.5) (0.5,-0.5) (0,0.5)) I'm passing to the shader with this code public void LoadData(BufferConfig config) where T : struct, IVertex { …
user8429339
-3
votes
1 answer

Unable to make a function/method for adding a vertex in graph with 4 attributes

I am unable to make a function/method for adding a vertex with 4 attributes in Java namely age, name, maritalStatus and index, where the new vertex needs to inserted in the specified index. Can someone please guide me how to go about this? How do…
pratzy
  • 93
  • 1
  • 1
  • 4
1 2 3 4
5