现在的位置: 首页 > 综合 > 正文

opengl入门系列-glVertexAttribPointer的解释

2019年11月12日 ⁄ 综合 ⁄ 共 276字 ⁄ 字号 评论关闭

glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized,  GLsizei stride, const void *ptr); 

函数的意义是为 Atrtribute 变量制定VBO中的数据。

参数:

1): index  , Attribute的索引

2): size, Attribute 变量数据是由几个元素组成的, x,y,z,w ; 最多四个。

3): normalized, 是否归一化, 编程1.0以内的数,这样做的目的是减少向gpu传递数据的带宽。

4): stride,  元素间隔,, 通常是0

抱歉!评论已关闭.