开发者

OpenGL: Set several texture coordinates

开发者 https://www.devze.com 2023-02-25 06:37 出处:网络
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

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

精彩评论

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