I'm trying to send an integer attribute to my GLSL shader. The shader receives the attribute as follows:
layout (location = 3) in int integer_value;
I'm creating the attribute as follows:
glBindBuffer(GL_ARRAY_BUFFER, this.integerValueVboId); glBufferData(GL_ARRAY_BUFFER, integer_values_buffer, GL_STATIC_DRAW); glVertexAttribPointer(3, 1, GL_INT, false, 0, 0);
this.integerValueVboId is a valid ID generated with all the other VBOs.
integer_values_buffer is an
IntBuffer confirmed to contain the correct integer values.
When I set one of the integer values to
1, the shader receives the integer value
1065353216, which I have found to be the value obtained when one interprets a float
1.0f as an integer value.