Jump to content
  • Advertisement
Sign in to follow this  
nhatkthanh

Multitexturing with vertex buffer object

This topic is 3571 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'm trying to do multi texture with vbo, but I ran into this and I'm not sure how to go about it. let say my vertex is: struct Vertex { float x, y, z; DWORD specularColor; float nx, ny, nz; float tu, tv; float tu2, tv2; }; the problem comes when I need to specify the array pointers as well as enable/disable clientstate. glVertexPointer(3, GL_FLOAT, stride, BUFFER_OFFSET(0)); glSecondaryColorPointer(4, GL_UNSIGNED_BYTE, stride, BUFFER_OFFSET(12)); glNormalPointer(GL_FLOAT, stride, BUFFER_OFFSET(16)); glTexCoordPointer(2, GL_FLOAT, stride, BUFFER_OFFSET(28)); then I'm not sure how to specify for the last set of texture coordinate. The same goes for enable client state: glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); I'm just not sure what I need to set for the last set of texture coordinate. Appreciate any help and info on this. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!