There are
glVertexAttribPointer()
glVertexAttribIPointer()
glVertexAttribLPointer()
I assumed glVertexAttribPointer
can be used instead of the other two.
If so, why do the I
and L
variations exist?
I read about this in OpenGL Insights
When using glVertexAttribPointer()
everything gets cast to a float. While glVertexAttribIPointer()
can only expose vertex arrays that store integers and glVertexAttribLPointer()
is only for doubles.
As confirmed by a quote on this OpenGL.org page:
For glVertexAttribPointer, if normalized is set to GL_TRUE, it indicates that values stored in an integer format are to be mapped to the range [-1,1] (for signed values) or [0,1] (for unsigned values) when they are accessed and converted to floating point. Otherwise, values will be converted to floats directly without normalization.
For glVertexAttribIPointer, only the integer types GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT are accepted. Values are always left as integer values.
glVertexAttribLPointer specifies state for a generic vertex attribute array associated with a shader attribute variable declared with 64-bit double precision components. type must be GL_DOUBLE. index, size, and stride behave as described for glVertexAttribPointer and glVertexAttribIPointer.