Unreal Engine 1 vertex mesh support

Moderator: GZDoom Developers

Post Reply
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Unreal Engine 1 vertex mesh support

Post by Marisa the Magician »

Being fed up with how unwieldy the MD3 format is (and after giving up on writing conversion tools from UE1 to MD3), I went and added support for the UE1 vertex mesh format directly, all by myself.

This is fully functional and tested thoroughly (excluding non-Linux platforms) but I think it may be a bit too "niche" of a format to be of any interest.

Source meshes are divided into two files: one for surface data (datafile, suffix _d.3d) and another for vertex positions (anivfile, suffix _a.3d); but I devised a quick and dirty way to pack them together (concatenated "UMSH" string + datafile + anivfile > .umsh file). This is also handy because the source files themselves have no signatures of any kind in their data that could be used for identification.

The branch is here, and here's a mod where I'm testing it all.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Post by Graf Zahl »

I made a pull requesrt out of this so I can actually test it.
But is it necessary to lump the files together? In a packed archive it should be no problem to get the data from the different files as long as they are in the same archive folder.
If you can make it so that it can load it from the separate files I see no reason not to add it.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Unreal Engine 1 vertex mesh support

Post by Marisa the Magician »

Still if that were the case how would I even detect the format in the first place?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Post by Graf Zahl »

I don't know the format's specs. Do you have a demo model I can look at?
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Unreal Engine 1 vertex mesh support

Post by dpJudas »

If there is no reliable way of detecting the model, maybe specify one of the files in modeldef and then have it grab the second one by changing the _a suffix to _d. Or maybe just list both files in the modeldef (probably the solution that requires the most work).
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Unreal Engine 1 vertex mesh support

Post by Marisa the Magician »

Specs are here
And as an example here's a pair for a simple dice: datafile anivfile

@dpJudas: I'll try doing it like that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Post by Graf Zahl »

That format is not well defined... :?
I still think this should be done without a specialized merger tool. Such a thing will render it perfectly useless. Any other ideas?
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Unreal Engine 1 vertex mesh support

Post by Marisa the Magician »

I've switched up the code so it attempts to load the file pairs if the model filename matches either _d.3d or _a.3d suffix.

I also updated the test mod to reflect this change, everything works just like before in-game.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Post by Graf Zahl »

That's better. Of course it needs no saying that the format itself is not nice, just being raw data with no header to check.
Also, do I get this right that the data contains no normals at all? How does this detect edges then?
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Unreal Engine 1 vertex mesh support

Post by Marisa the Magician »

In short, it doesn't. Normals are done per-vertex by averaging the computed normals of each triangle that contains them. Sharp edges are made by duplicating vertices and assigning them to separate faces.

It's all very rudimentary and it shows how this was made with stuff like OpenGL 1.x in mind.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Post by Graf Zahl »

So was MD2 - and that did contain normals. It had other shortcomings, of course.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Unreal Engine 1 vertex mesh support

Post by Marisa the Magician »

Ah, dangit. You merged it before I committed an important fix.

I opened PR #481 for it.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”