Sign in to follow this  
Psyian

Another 3DS Max exporter Issue........

Recommended Posts

Hi guys, I'm currently writing my 3DS max exporter, and have come across a problem i'm not sure how to resolve, so i thought i'd ask the crew. I'm using the IGame interface to get round Max's crappy co-ordinate system (sorry to the guy's at discreet, it was written quite a while ago, i'm sure, I've been using it for 8 years or so, i forgive you, great program!!). Anyhooo Max uses texture coordinates at the face level, so a uv co-rd for each face index. NOw to transfer this to D3D i have 2 options. 1) Spit each vertex for each uv co-ord. 2) Use multiple tex co-ords for each vertex. Now, scenario 1) would produce multiple vertices with the same position co-ords. Now to me that seems very wasteful, as DrawIndexedPrimitive becomes effectively redundent, i think. I might as well use DrawPrimitive. Scnario 2) would lead to vertices greater than 32 bytes, i'll explain. I watched a fella at ATI give a presentation at the GDC about optimising D3D(video available at the ATI website, great presentation!!) who said vertices should be kept at 32 bytes each to avoid cache line performance issues. All 32 bytes can give you from my understanding is a position, normal and 1 set or uv co-ords. This could be overcome by normal maps to remove the normal and gain an extra set of uv co-ords, but would result in being less than a cache line, screwing up the cache line optimisation. So at the end of the day what do i do? From my max output i can see that some vertices share the same uv co-ords, thus reducing the number of split vertices. And with models using only one texture map, would lead to few split vertices. But then i am aiming to add skinning and vertex weighting to my vertices, whick=h in theory would ruin the cache line optimisation. Sorry for the brain dump guys, i think i just need some like minded folk to bounce ideas off. As always, any response appreciated. Laters Psyian

Share this post


Link to post
Share on other sites
Most exporters, including the Microsoft X-file exporter (and the Panda one), create multiple vertices to account for the annoying tex-coord issue. In the end, it's much easier that to render with multiple UV's in DirectX. Plus, if your texturing is not that complicated in 3ds Max, the vertex count and UV count will be close, if not the same.

Most modern apps won't be able to fit their vertex into a 32-byte structure, simply do to all the info that must be stored. You have position, normal, tangent, texCoords, bone weights, ect... So I wouldn't really worry about that too much, because it's going to happen anyways.

Share this post


Link to post
Share on other sites

Thanks for replying circlesoft, (like your site dude!!).
So in theory this 32 byte cache line performance optimisation which the fella said was really bad to break, is completely unatainable, which i kinda thought. So the next best level would presumably be 48 and 64 bytes per vertex.

I think i already knew this but needed someone to confirm it for me.

Thanks again dude,

Laters

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