开发者

OpenGL: Set several texture coordinates

How to set several texture coordin开发者_开发百科ates for one vertex?


In Immediate Mode you use glMultiTexCoord for this: http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml

Code example

glBegin(GL_TRIANGLES);
glMultiTexCoord2f(GL_TEXTURE0, s0, t0);
glMultiTexCoord2f(GL_TEXTURE1, s1, t1);
glMultiTexCoord2f(GL_TEXTURE2, s2, t2);
glVertex3f(...);

/* ... */
glEnd();

Using Vertex Arrays you use glClientActiveTexture to select the texture unit the following calls to glTexCoordPointer are related to.

If you're using shaders you may as well assign multiple texture coordinates to a set of vertex attributes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜