Jump to content
  • Advertisement

Archived

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

sbennett

Multitexturing...vertex arrays

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

Does anybody know what may be wrong with the following code? .... glVertexPointer(...); glClientActiveTextureARB(GL_TEXTURE0_ARB); glTexCoordPointer(...); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glClientActiveTextureARB(GL_TEXTURE1_ARB); glTexCoordPointer(...); glEnableClientState(GL_TEXTURE_COORD_ARRAY); The texture0 coordinates work out fine, but the texture1 coordinates seem to be stuck at (0,0) for all vertices. I''m using the same array for both texture units coordinates, is this wrong?

Share this post


Link to post
Share on other sites
Advertisement
nope nothing wrong with the code it should work, perhaps the bug lies elsewhere

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
No need for enabling tex-coord arrays twice though

Edit:

Oh and by the way, the texture coordinates being stuck might have something to do with the floats not being casted correctly. Just a feeling

Edited by - newdeal on February 1, 2002 7:03:04 PM

Share this post


Link to post
Share on other sites
>>No need for enabling tex-coord arrays twice though <<
yes there is unless u dont want it to work

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
I believe you need to enable GL_TEXTURE_COORD_ARRAY for each texture unit.

But wouldn''t you do it before you called glTexCoordPointer()?

-Mezz

Share this post


Link to post
Share on other sites
This is how my code looks

  
glEnableClientState (GL_VERTEX_ARRAY);
glEnableClientState (GL_TEXTURE_COORD_ARRAY);

glActiveTextureARB(GL_TEXTURE0_ARB);
textures->BindTexture(5);
glEnable(GL_TEXTURE_2D);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
textures->BindTexture(4);

// and in the rendering loop


glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(2, GL_FLOAT, 0, &TArray[0]);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(2, GL_FLOAT, 0, &TDArray[0]);

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!