Jump to content
  • Advertisement

Archived

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

ade-the-heat

VAs and Multitexturing

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

My card supports compiled VAs and Multitexturing. I can render my scene with VAs and without multitex. However, when I try and use VAs with multitexturing it doesn''t work. The problem as I see it is that I need to specify the texture units for the multuitexturing on building my vertex arrays. Obviously this is simple with out multitexting, but how do I do it for multitexuring ? eg - with no multi I do the following: m_texcoordArray[currentVertex][0] = (float) x; m_texcoordArray[currentVertex][1] = (float) z; cheers

Share this post


Link to post
Share on other sites
Advertisement
- enable texture unit
- bind texture
- set pointer to texture coords
- enable next texture unit
- bind texture
- set pointer to texture coords
- draw like normal

Share this post


Link to post
Share on other sites
you mean like this:-

glClientActiveTextureExt(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, tiles[tileno].tex);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

//set 2nd tex
glClientActiveTextureExt(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, tiles[tileno].tex2);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

it still looks wrong...

cheers

Share this post


Link to post
Share on other sites
ok, so I did this:

glClientActiveTextureExt(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, tiles[tileno].tex);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
//text coord pointers here !
glTexCoordPointer(2, GL_FLOAT, 0, m_texcoordArray);

//set 2nd tex
glClientActiveTextureExt(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, tiles[tileno].tex2);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, m_texcoordArray);


Still looked the same

Share this post


Link to post
Share on other sites
how does it look ''wrong''? how do you expect it to look? atm from the code you''ve posted it looks like you are putting two textures at the same place, thus texture 2 will overwrite the second texture, to do anything else requires teh blending to be setup correctly

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!