Jump to content
  • Advertisement

Archived

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

ade-the-heat

multitex-now lost all subsequent textures

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

I enabled multitex. Sort of worked ok, but everything else that had lovely textures to them are now plain dull colors. I''m guessing somewhere I have to turn off the multitexing ?? So, here''s the bit just before I draw: ============= glActiveTextureExt(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 0, m_texcoordArray); glBindTexture(GL_TEXTURE_2D, tiles[tileno].tex); // Activate the second texture ID glActiveTextureExt(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 0, m_texcoordArray); // Here we turn on the COMBINE properties and increase our RGB glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2); // Bind the 2nd texture glBindTexture(GL_TEXTURE_2D, tiles[tileno].tex2); ============= here''s the bit just after drawing my terrain to reset stuff ============= glDisable(GL_BLEND); glDepthMask(GL_TRUE); glDepthFunc(GL_LESS); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glDisable(GL_ACTIVE_TEXTURE_ARB); glDisable(GL_CLIENT_ACTIVE_TEXTURE_ARB); ============= But all textures after this are a dull one color. If I don''t do multitexting then all is fine. So it must be the abovelines. What''s wrong ? cheers

Share this post


Link to post
Share on other sites
Advertisement
I'm not *quite* sure what you mean by dull colors, but I assume you mean it looks like the brightness on the texture went down a lot. If you don't have multitexturing on an object, OpenGL will blend them anyway so you get about 0.5 * the brightness, so you need to disable the second texture layer when you want to draw only one layer on a polygon:

glActiveTextureExt(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
glActiveTextureExt(GL_TEXTURE0_ARB);

Or you can try this in conjunction but i think it's too bright:
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1);


[edited by - uber_n00b on June 7, 2004 6:03:22 PM]

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!