Development > Artwork

A question about MDX files

(1/3) > >>

Andermaiden:
Hi, does anybody know what the mdx file format stands for? What information carries and how to export them? I couldn't find any information here about the mdx but it seems like it's an important file format for the models as every model has one. From what I searched, it is a 3d mesh file format used in some blizzard games, but the md2 already stores the information for the mesh so I'm clueless as to how does it relate with the md2.

geever:

--- Quote from: Andermaiden on July 16, 2017, 11:13:33 pm ---Hi, does anybody know what the mdx file format stands for? What information carries and how to export them? I couldn't find any information here about the mdx but it seems like it's an important file format for the models as every model has one. From what I searched, it is a 3d mesh file format used in some blizzard games, but the md2 already stores the information for the mesh so I'm clueless as to how does it relate with the md2.

--- End quote ---

Our mdx files are generated by the ufomodel tool. It pre-calcuates normals and tangents to speed up model loading a bit. You can safely remove and recreate the mdx with the ufomodel tool. The game works without mdx-es fine.

-geever

Andermaiden:

--- Quote from: geever on July 17, 2017, 04:31:25 pm ---Our mdx files are generated by the ufomodel tool. It pre-calcuates normals and tangents to speed up model loading a bit. You can safely remove and recreate the mdx with the ufomodel tool. The game works without mdx-es fine.

-geever

--- End quote ---
Thanks a lot for the tip! Now by any chance do you know of any charitable soul who has an already compiled ufomodel.exe? 'cause I'm not being able to compile it with codeblocks (I've been having trouble trying to install a compiler in a proper way)

Sandro:

--- Quote from: geever on July 17, 2017, 04:31:25 pm ---Our mdx files are generated by the ufomodel tool. It pre-calcuates normals and tangents to speed up model loading a bit. You can safely remove and recreate the mdx with the ufomodel tool.

--- End quote ---

It doesn't. Our talk over the IRC led me to investigate it again (forgot the previous results), and no, it does not store any normals. It is a bidirectional vertex<->index map for indexed representation of models, with duplicate vertices removed. And that's pretty much all. See the R_ModLoadMDX() for yourself -- it only processes the indices.


--- Quote from: geever on July 17, 2017, 04:31:25 pm --- The game works without mdx-es fine.

--- End quote ---

It just recalculates it on every load by the O(n^2) algo with quite a big multiplier. See the  R_ModCalcUniqueNormalsAndTangents(), which does NOT exactly do what its name suggests. Normals get recalculated every frame anyway.

P.S.: Proper name should be something along the lines of R_ModFindSharedVerticesForReuse(), or something like it.

geever:
Thanks Sandro for correcting me. As you know I'm not much into the Renderer or graphics in general and yeah, I guessed what it exactly does from the function name. Could you maybe update the code to better reflect what it does? Maybe adding some in-line documentation?

Andermaiden: I checked, ufomodel.exe is not shared by our buildbot, unfortunately. I'd need Windows or make a cross-compiler work on my computer to make one. Not that it is impossible but someone else might provide it faster than me. Btw. did you try the pre-packaged Code::Blocks we share? It wasn't updated for a while, so I cannot guarantee that it works, but may worth a try.

-geever

Navigation

[0] Message Index

[#] Next page

Go to full version