Jump to content
  • Advertisement

Archived

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

Ilici

Multitexturing Problems

This topic is 5625 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, i''ll get right 2 the point: i have multitexturing problem in my app. it''s a 3d terrain simulator. after i draw the terrain, with the multitexturing part, the textures of other objects (the sky) flicker. i suspect a problem with drivers, but i''m not sure. if anyone has experienced this problem pls tell me. /*ilici*/

Share this post


Link to post
Share on other sites
Advertisement
i checked the code but still nothin
here it is

glVertexPointerEXT(3, GL_FLOAT, 0, 12, m_vertArray);
glEnableClientState(GL_VERTEX_ARRAY);

glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TerTex.texnum);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointerEXT(2, GL_FLOAT, 0, 12, m_texcoordArray);
if(rMultiTex)
{
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, DetailTex.texnum);

glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointerEXT(2, GL_FLOAT, 0, 32768, m_multiTexCoordArray);

glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
}


/*render stuff*/


if(rMultiTex)
{
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);





/*ilici*/

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i dunno if this has anything to do with it ..
glTexCoordPointerEXT <- dont use this, use glTexCoordPointer()

Share this post


Link to post
Share on other sites
Alhough you disable the texture coord array, you don''t disable the texture unit itself. Try this change :

glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable( GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);

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!