Jump to content
  • Advertisement
Sign in to follow this  
Samurai Jack

OpenGL Nonindexed to Indexed buffer?

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

Greetings! I was wondering whenever I could convert non indexed vertex buffers / meshes to indexed? I will gather a list of vertices. So the user will not specify vertices and their face indexes but just vertices, like OpenGL does. The only problem is, i don't wanna parse the entered list and build the lists myself, instead i was wondering, i D3DX is able to convert non indexed mesh to indexed one by itself?

Share this post


Link to post
Share on other sites
Advertisement
You may be able to do this with mesh optimization and welding. Non-indexed data is really juse indexed consecutively. The non indexed geometry v1,v2,v3.. has an implied index 0,1,2...

You can create a mesh and fill the VB with your vertex data and fill the IB with the implied index counting from 0 to the length of your VB.

Once you have a mesh you should be able to generate adjacency information and use the supplied convert, optimize and weld methods to eliminate duplicate verts and generate a triangle strip index.

When you are done with the mesh you can extract the VB and IB data but be aware that the attribute table may specify rendering devisions after calling optimize functions.

SEE: ID3DXBaseMesh::LockIndexBuffer, ID3DXBaseMesh::LockVertexBuffer, D3DXConvertMeshSubsetToSingleStrip, D3DXConvertMeshSubsetToStrips, D3DXWeldVertices, ID3DXMesh::OptimizeInplace.

Share this post


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

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