Jump to content
  • Advertisement

Archived

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

Crawl

Multitexturing with glDrawElements

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

Can someone show me how to do multitexturing with glDrawElements(). I know this question has been asked before but a forum search didn't reveal anything...
    
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(VERTEX), m_pVertexBuffer[0].u);
glDrawElements( GL_TRIANGLES, m_pNode->m_dwPolyCount, GL_UNSIGNED_SHORT, m_pNode->m_pPolys );
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
  
Is there any way to pass the texture coordinates for the second (or third, etc) texture layer to OpenGL....???? -Crawl [edited by - Crawl on June 1, 2002 11:17:51 AM]

Share this post


Link to post
Share on other sites
Advertisement
Thanx, i see their BSP tutorial uses the technique, looked there before but probably not hard enough,.....

Share this post


Link to post
Share on other sites
You need to do something like this ...

      
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(... lightmaps ...);


glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(... texcoords ...);


glDrawElements(...);


Oh ... and make sure that you enable GL_TEXTURE_COORD_ARRAY for each texture unit.

[edited by - Martee on June 1, 2002 1:39:42 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!