[Added] Unreal Engine 1 vertex mesh support

Moderator: Developers

Unreal Engine 1 vertex mesh support

Postby Marisa Kirisame » Mon May 14, 2018 7:38 pm

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
Marisa Kirisame
ZScript Magician
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: Unreal Engine 1 vertex mesh support

Postby Graf Zahl » Tue May 15, 2018 1:26 am

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Postby Marisa Kirisame » Tue May 15, 2018 1:34 am

Still if that were the case how would I even detect the format in the first place?
User avatar
Marisa Kirisame
ZScript Magician
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: Unreal Engine 1 vertex mesh support

Postby Graf Zahl » Tue May 15, 2018 1:38 am

I don't know the format's specs. Do you have a demo model I can look at?
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Postby dpJudas » Tue May 15, 2018 1:52 am

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).
dpJudas
 
 
 
Joined: 28 May 2016

Re: Unreal Engine 1 vertex mesh support

Postby Marisa Kirisame » Tue May 15, 2018 2:06 am

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
Marisa Kirisame
ZScript Magician
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: Unreal Engine 1 vertex mesh support

Postby Graf Zahl » Tue May 15, 2018 2:27 am

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Postby Marisa Kirisame » Tue May 15, 2018 3:34 am

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
Marisa Kirisame
ZScript Magician
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: Unreal Engine 1 vertex mesh support

Postby Graf Zahl » Tue May 15, 2018 3:43 am

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Postby Marisa Kirisame » Tue May 15, 2018 3:51 am

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
Marisa Kirisame
ZScript Magician
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: Unreal Engine 1 vertex mesh support

Postby Graf Zahl » Tue May 15, 2018 4:03 am

So was MD2 - and that did contain normals. It had other shortcomings, of course.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Unreal Engine 1 vertex mesh support

Postby Marisa Kirisame » Wed May 16, 2018 2:40 pm

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

I opened PR #481 for it.
User avatar
Marisa Kirisame
ZScript Magician
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests