Archived

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

Multi-Texture mapping question

This topic is 5797 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

  
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
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
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