Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
不知何故,此信息在 Google 上不存在。
我需要将纹理坐标传输到我的着色器程序,但 ATTRIB_TEXCOORD 不存在。我如何处理 glVertexAttribPointer?
谢谢你。
给定一个着色器程序和纹理属性的名称(在本例中,该属性名为“textureCoords”),您将获得如下索引:
int a_texture = glGetAttribLocation(program, "textureCoords");
然后像这样在 glVertexAttribPointer 中使用 a_texture :
glVertexAttribPointer(a_texture, 2, GL_FLOAT, 0, 0, textureVertices);