Archived

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

Managing vertex and tex coord data in IB

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

Assume you would like to render a simple cube with different textures at each of its 6 faces. AN index buffer approach would be fine since it reduces the vertex data by factor 3. The VB format would be something like XYZ | TEX1. But this way I have to share the tex coord for each vertex - thats not what I want since one vertex has different tex coords for the three textures. I just found two ways to go, both with huge disadvantages: 1) dont use IB, just have the data in VB. This way I have to specify each vertex three times for the three different tex coords. What a waste! Surely not the way to go. 2) Use a Vertex Shader which defines that the vertex data comes from a first VB of format XYZ and that the tex coords data comes from a second VB of format TEX1. Now I can index them - but not independantly, so again I have to pass much more data than necessary. Do you know a better way? DX-Demo&3D code and docu avoid touching it, hopefully not for good reasons. Thank you for any help! - thomas

Share this post


Link to post
Share on other sites