Archived

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

Multitexturing Problems

This topic is 5377 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
It seems like a code problem to me, since the flickering probably means you don''t texture the sky like you should. Maybe you did not disable multitexturing right after drawing the terrain? I''m not sure but my first guess is it has something to do with this...

| Panorama 3D Engine | Contact me |
| MSDN | Google | SourceForge |

Share this post


Link to post
Share on other sites
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