Vertex attributes:
所有 OpenGL ES 3.0 的实现必须至少支持16个vertex attribute,实际支持的个数可以通过GL_MAX_VERTEX_ATTRIBS查询
GLint maxVertexAttribs; // n will be >= 16
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
Constant Vertex Attribute
void glVertexAttriblf(GLuint index, GLfloat x);
void glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y);
void glVertexAttrib3f( GLuint index, GLfloat x, GLfloat y, GLfloat z);
void glVertexAttrib4f( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glVertexAttriblfv(GLuint index, const GLfloat *values);
void glVertexAttrib2fv(GLuint index, const GLfloat *values);
void glVertexAttrib3fv(GLuint index, const GLfloat *values);
void glVertexAttrib4fv(GLuint index, const GLfloat *values);
The glVertexAttrib*commands are used to load the generic vertex attribute specified by index.
其中
(1)glVertexAttriblf 和 glVertexAttriblfv 加载 (x, 0.0, 0.0, 1.0)
(2)glVertexAttrib2f 和 glVertexAttrib2fv 加载 (x, y, 0.0, 1.0)
(3)glVertexAttrib3f 和 glVertexAttrib3fv 加载 (x, y, z, 1.0)
(4)glVertexAttrib4f 和 glVertexAttribl4fv 加载 (x, y, z, w)
一般来说使用Constant Vertex Attribute类似于使用a scalar/vector uniform
index应该指明的是什么属性
Vertex arrays
使用glVertexAttribPointer 或者 glVertexAttribIPointer