Questions tagged [vertex-attributes]
73 questions
2
votes
1 answer
Clarification on glVertexAttribPointer index paramter
I have a very simple program to display a 3D triangle in OpenGL. hat value I put in, it does not display correctly. I put in the following array into the vertex buffer
float triangle[] = {
// x y z r g b a
0.2f,…

LardPies
- 95
- 7
2
votes
1 answer
OpenGL vertex shader is fast on Linux, but extremely slow on Windows
To draw power spectral density of a signal (which is very similar to heatmap), I use this vertex shader program. It receives value of power at each vertex, takes logarithm to show result in dB, normalizes within the range of colormap array, and…

Ali Tavakol
- 405
- 3
- 11
2
votes
2 answers
InputLayout which binds vertex attributes to a constant value?
I'm trying to port some code from OpenGL to DirectX - in OpenGL it is possible to disable a certain vertex attribute and set it to a constant value.
const GLfloat data[] = { 1.0f, 0.0f, 0.0f, 1.0f };
GLuint location = glGetAttribLocation(program,…

Constantin
- 8,721
- 13
- 75
- 126
2
votes
1 answer
Is this diagram for OpenGL data types correct?
I'm trying to understand glVertexAttribPointer, and I noticed that it accepts many more types than those that have an equivalent in GLSL. So to write down everything I know so far, I made this diagram matching all the types (except for the packed…

AlphaModder
- 3,266
- 2
- 28
- 44
2
votes
1 answer
Using subgraph() and preserving vertex attributes with igraph python
I want partition my disconnected graph into blocks (to use community_spinglass). However once I get the subgraph and use community_spinglass() the labels of the vertex in the original graph are lost. I am dealing with 40+ vertices so it is not easy…

RM-
- 986
- 1
- 13
- 30
2
votes
1 answer
Geometry shader doesn't seem to accept input attribute
I am passing a line to the geometry shader and outputting a cuboid. I create 4 new points at each end of the line which was passed in by adding a constant "thickness" in the x or y direction. If I set the thickness in the geometry shader, it works…

pseudomarvin
- 1,477
- 2
- 17
- 32
2
votes
3 answers
Is automatic vertex attribute assignment guaranteed to be in the correct order?
When specifying the vertex attribute location in the shader code using layout(location = ...) I do not need to fetch the locations using glGetAttribLocation in my C++ program.
If I neither define the location in the shader using the layout…

danijar
- 32,406
- 45
- 166
- 297
2
votes
2 answers
Using GL_INT_2_10_10_10_REV in glVertexAttribPointer()
Can anybody tell me how exactly do we use GL_INT_2_10_10_10_REV as type parameter in glVertexAttribPointer() ?
I am trying to pass color values using this type. Also what is the significance of "REV" suffix in this type ? Does it require any special…

maverick9888
- 498
- 6
- 16
1
vote
1 answer
Passing vertex attributes with layouts in geometry shader
Let's say we have a GL program consisting of the following vertex, geometry and fragment shaders.
vertex:
#version 410
layout (location = 0) in vec2 pos;
layout (location = 1) in vec2 size;
layout (location = 2) in float rot;
layout (location = 3)…

bamia
- 333
- 3
- 15
1
vote
0 answers
Transfer Vertex-Attributes to Texture bad texture results
I use MeshLAB 2022.02 on Windows 64 16GB RAM Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz 4.00 GHz
So currently I am working on creating a textured mesh from point cloud data. Firstly, I Compute the Normals for point sets; then Screened Poisson to…

Sisi
- 11
- 4
1
vote
1 answer
Don't fully understand the concept of Vertex Attributes
I was following the OpenGL tutorial on learnopengl.com, and decided to test if I've fully grasped the concept of Vertex Attributes. I tried tweaking the code just to see if it works behind the scenes the way I think it does.
Here's what my modified…

Rapid Readers
- 303
- 1
- 3
- 13
1
vote
1 answer
C++ directx 11 how to interleave unknown number of vertex attributes
I have read many articles saying to interleave vertex attributes by putting the data in a structure
struct Vertex
{
XMFLOAT2A vertex;
XMFLOAT3A color;
.
.
.
}
This works fine for tutorials but for real world models loaded from…

Sync it
- 1,180
- 2
- 11
- 29
1
vote
1 answer
Can't Run two Shader Programs together, however Each one work fine when used a lone
Ok been strangling with this for 2 days.
I have a small GLES2/Android App... two objects (both are squares but only one has texture coordinates). I have two Shader Programs, one deal with textures and its coordinates, the other just use a color in…

Newbie And Curious
- 145
- 10
1
vote
1 answer
Should the indices of glVertexAttribPointer() be contiguous?
glVertexAttribPointer()'s first argument is an index representing where the vertex attribute resides, Opengl offers a minimum of 16 slots.
I want all 16 to represent different vertex attributes (position=0, uvs=1, colors=3, weights=8, etc) and for…

Anne Quinn
- 12,609
- 8
- 54
- 101
1
vote
1 answer
Confusion about binding the index of a non-existent attribute using glVertexAttribPointer
When binding an attribute index using glVertexAttribPointer, what happens when an associated program does not contain an attribute at said index?
Is the behaviour undefined, or is the attribute ignored altogether?
I have searched the docs quite…

invertedPanda
- 142
- 1
- 7