Sign in to follow this  
mauro78

[DX9] Texture Coords from 3DSMAX

Recommended Posts

Hi All! After working with .x file format for a while, I've decided to write a plugin to export assets from MAX 9. Everything it's ok I've only one problem with vertex/face UV. I Know that MAX let me export UV face map, and I correctly extracted those data from MAX. But the problem is: Directx need UV per vertex; texture map UV are assigned per face, so a vertex can have more than one texture map vertex assigned based on the face in wich is referenced. A simple solution is to not use INDEXED_PRIMITIVE and send to the GPU a list of faces (or triangles); in that way I can easily assign to every mesh vertex the correct texture vertex. But I'm wondering; what is the best approach on the problem? Thanks in adavance EDIT: Solved with the simple solution: now I'm searching on a good algorithm to optimize the mesh. If someone has good pointers on this would be appreciated Regards [Edited by - mauro78 on December 25, 2009 2:35:22 AM]

Share this post


Link to post
Share on other sites
You'll need to compare all vertices with all other vertices and remove the duplicates (insert fav. optimisation here). Your simple solution kills the vertex caches. I usually end up making a hash of the vertex and only compare those with the same hash.
The final set of vertices is constant, so no algorithm is "better" than any other at this in terms of the output.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this