Archived

This topic is now archived and is closed to further replies.

Waldoo

Multi-Texture mapping question

Recommended Posts

Brother Bob    10344
  
glActiveTexture(GL_TEXTURE0); // activate first textuer unit

glBindTexture(GL_TEXTURE_2D, tex0); // bind texture to first unit

glActiveTexture(GL_TEXTURE1); // activate second texture unit

glBindTexture(GL_TEXTURE_2D, tex1); // bind texture to second unit


Then you need to specify texture coordinates for both units.
  
glBegin(GL_QUADS);
glMultiTexCoord2f(GL_TEXTURE0, 0, 0); // coordinates for first texture

glMultiTexCoord2f(GL_TEXTURE1, 0, 0); // coordinates for second texture

glVertex2f(...); // first vertex

... // and so on, for each vertex

glEnd();

Share this post


Link to post
Share on other sites
_DarkWIng_    602
sorry to ruin your dream.. but there IS init code.. and quite ugly one.. Look at tutorial 22... it''s all there...

There are more worlds than the one that you hold in your hand...

Share this post


Link to post
Share on other sites
Eber Kain    130
That looks pretty easy, can you assign colors for the seperate textures?

When he''s best, he''s little worst than a man,
When he''s worst, he''s little better than a beast.

Share this post


Link to post
Share on other sites