Jump to content
  • Advertisement

Archived

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

Lukerd

Simple Multi-Texturing Question

This topic is 6011 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

Hi After much fiddling I finally got hardware multitexturing working but there is a problem. All the stuff I draw that shouldn''t be multitextured, is multitextured. I guess I''m asking How Do You Turn Multitexturing Off? or is there another way? "To err is human, to really mess up requires a computer"

Share this post


Link to post
Share on other sites
Advertisement
Sure you can turn it off, how did you turn it on?

// To enable multitexture:
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, tex0);
glEnable(GL_TEXTURE_2D);

glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, tex1);
glEnable(GL_TEXTURE_2D);

// To disable texturing for unit 1 only
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);

// To disable all texturing
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);

glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_2D);

Dare I say RTFM? ;-) Nah I daren''t, as the extension specs aren''t that nice to read. A good document is at:
http://www.berkelium.com/OpenGL/GDC99/multitexture.html

Hope this helps,

- Pete

Share this post


Link to post
Share on other sites
It''s (probably) because you don''t disable the extra texture units you use. When using multitexturing, you bind a texture to each unit and then enable it. And when you''re done, you must disable the units you no longer need.

  
glActiveTexture(GL_TEXTURE0); // select and activate first unit

glBindTExture(...);
glEnable(GL_TEXTURE_2D, ...);

glActiveTexture(GL_TEXTURE1); // select and activate second unit

glBindTExture(...);
glEnable(GL_TEXTURE_2D, ...);

// Use multitexturing here


glActiveTexture(GL_TEXTURE1); // might be rendurant, but just to show you how it works

glDisable(GL_TEXTURE_2D); // second texture unit is now disabled

Share this post


Link to post
Share on other sites
Thanks I didn''t realise that using glDisable(GL_TEXTURE_2D) that way only disabled that texture unit. I thought it would just disable all textures.

Thanks again.

Lukerd

"To err is human, to really mess up requires a computer"

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!