Advertisement

Multi-Texture mapping question

Started by January 29, 2002 12:46 AM
13 comments, last by Waldoo 23 years ago
How do you put several separated texture mappings on a single square? Waldoo Edited by - waldoo on January 29, 2002 2:00:52 AM
  glActiveTexture(GL_TEXTURE0); // activate first textuer unitglBindTexture(GL_TEXTURE_2D, tex0); // bind texture to first unitglActiveTexture(GL_TEXTURE1); // activate second texture unitglBindTexture(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 textureglMultiTexCoord2f(GL_TEXTURE1, 0, 0); // coordinates for second textureglVertex2f(...); // first vertex... // and so on, for each vertexglEnd();  
Advertisement
Is it really that simple? That''s all? No initialisation code? Nothing?

Cool
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...
You should never let your fears become the boundaries of your dreams.
Where is tutorial 22?

Waldoo
Bummer

Oh well... to answer the "were is..." question... Look at the name of the forum...
Advertisement
Hi,

See on my site, I''ve a simple example for multi-texturing.


========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
I didnt mean that. What I mean is several separated pictures on a square. A picture of anything on each corner (4 pictures).

Waldoo
Split your geometry in 4 sub-squares and bind a different texture for each sub-square.
oops I didn''t see another topic was opened. sorry.

This topic is closed to new replies.

Advertisement