Forum

How to get proper skins from QME 3.1

Discuss the creation of various model formats for Quake engines, and related matters to modeling.

Moderator: InsideQC Admins

How to get proper skins from QME 3.1

Postby gnounc » Fri Apr 30, 2010 10:16 am

For some reason QME 3.1 does not save skins correctly.
Maybe its just my setup, but in case its not I thought I would
post what FINALLY worked for me.

export the skin from qme 3.1

then use sajt's qwalk to convert the mdl to mdl
and point the -tex argument to your exported skin

I have a bat file that says

modelconv.exe -i armor.mdl armor2.mdl -tex bomb.jpg

for instance.

uuuurgh, upon further inspection, they still dont show up nicely in directq but they look fine in darkplaces.
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Postby Sajt » Fri Apr 30, 2010 2:27 pm

Your skin width is probably not a multiple of 4. If I remember correctly QWalk takes care of that though, by padding the texture and the texcoords...

However, importing MDL then exporting MDL in QWalk is bad, because it will duplicate some vertices and possibly the vertices will drift a bit or be requantized badly (it's not designed for MDL's old-fashioned way of storing triangles). I don't know why it would not show up properly though, whatever that means. Maybe you could post your model?

I could make a tiny tool called "FixMDL", if you want, which would fix these sort of problems in MDLs without any kind of recompression. It would only take a few hours, probably.

You can also fix it in QME by changing the skinwidth to a multiple of 4, then manually fixing the skin to line up again with the re-fudged texture coordinates...
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby ceriux » Fri Apr 30, 2010 2:53 pm

you should make a tool which fixes the .mdl problems when making/editing a model using qme 3.1
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby gnounc » Sat May 01, 2010 5:14 am

http://dl.dropbox.com/u/1776436/bomb.mdl

thats my model.

I'll look into texture sizes.

But definately, if you can write a program to fix qme problems, I'd
be very grateful.
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Postby Sajt » Fri May 07, 2010 3:25 am

I don't know why the models that have been run through QWalk show up funny in old engines. I assume you are talking about the funny lighting where it looks like there is a black stair-step pattern across the bomb?

I've been working on a program to fix various MDL problems, along with a few other features like the flat-shading thing Urre wanted. It's a Windows GUI program, unlike QWalk.

Could you upload the original model, the one with the messed up skin? I'll be able to upload the first version of my MDL-fixing program once I test this. The program should be able to fix both messed-up versions of your model.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby gnounc » Fri May 07, 2010 7:47 am

http://dl.dropbox.com/u/1776436/nofix.mdl

There ya go. That shows up fine in QME 3.1 but not in game, or in
your viewer.

After using qwalk, it shows up fine in the viewer and darkplaces, but not DirectQ.

Thanks again.
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Postby Sajt » Fri May 07, 2010 7:39 pm

Man, the way QME stores non-multiple-of-4-width textures is incomprehensible. The QWalk step worked because you were reimporting the skin from an external image. I'm trying to figure out how to salvage what QME pukes into the model in these cases...

edit: I did finally figure it out. You may notice a black horizontal stripe that QME "inserts" into the top right of your skin if your skin's width isn't a multiple of 4. Mr. Rene Post when he did this was clearly smoking some unsavoury hashish in the slums of Amsterdam. "Decoding" these skins involved flipping the image upside down, then "unshearing" it by ignoring certain inexplicable black pixels (or relocating them to the end), then flipping the image again.

Unfortunately, further complications seem to have arisen in the texture coordinates for these models. I highly recommend sticking to a texture width multiple of 4 from the very start... even though that isn't possible when generating the skinmap using QME.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Sajt » Sat May 08, 2010 10:45 pm

http://www.icculus.org/qshed/fixmdl/FixMDL-0.1-ALPHA.zip

Give this a shot, use it on your OLD model with the messed-up skin. I haven't yet implemented the fix for the model you ran through QWalk.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Works like a charm!

Postby gnounc » Sun May 09, 2010 6:19 am

Thanks a bunch. Model displays properly now.

Planning on unifying these tools into 1 Gui eventually?
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Postby Sajt » Sun May 09, 2010 4:36 pm

Maybe, but I'd prefer not to use the Win32 API. I would rather it be an OpenGL application with hand-written GUI components. Unfortunately, all the code I've written to do that sort of thing (as well as improved file handling, image loading, etc.) is not currently GPL. So for now I doubt there will be new versions of QWalk, unless somebody asks. There's no way I'm recoding all that stuff for the tenth time in my life (nine is enough!), so we'll just have to wait until I can decide to make all my personal work GPL... Or, I suppose, I could make a closed-source follow-up to QWalk, but people probably wouldn't like that.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby frag.machine » Mon May 10, 2010 12:22 am

I'd suggest you to pack everything in a lib and release it under the LGPL. So somebody else can try to make a GUI for that.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby gnounc » Mon May 10, 2010 7:11 am

Thats too bad, it would be great to be able to convert a model, fix any misalignments and instantly view them all in the same window.
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Postby mh » Mon May 10, 2010 9:17 am

I'm gonna download this model and test it a little later on. I'm guessing that what's happening here is that DP has some special case code for loading non-standard MDLs which may be why it works OK there. If I was a betting man I'd be pointing my finger at skin floodfilling as being the particular thing in the engine to blame.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby mh » Mon May 10, 2010 5:11 pm

mh wrote:I'm gonna download this model and test it a little later on. I'm guessing that what's happening here is that DP has some special case code for loading non-standard MDLs which may be why it works OK there. If I was a betting man I'd be pointing my finger at skin floodfilling as being the particular thing in the engine to blame.

Good thing I'm not a betting man! :lol:

Here's what I get when I dump the skin from DirectQ:

Image

This is just raw data as it comes directly from the MDL before my own code (or ID's for that matter) has it's evil way with it, so it definitely seems to be a case of QME weirdness.

I wonder does it also mangle the texcoords to make it work (for certain definitions of "work")?

Neither width (306) nor height (43) are a multiple of 4, which will actually cause a Sys_Error if you try to use it in regular GLQuake.

Sajt wrote:Man, the way QME stores non-multiple-of-4-width textures is incomprehensible. The QWalk step worked because you were reimporting the skin from an external image. I'm trying to figure out how to salvage what QME pukes into the model in these cases...

edit: I did finally figure it out. You may notice a black horizontal stripe that QME "inserts" into the top right of your skin if your skin's width isn't a multiple of 4. Mr. Rene Post when he did this was clearly smoking some unsavoury hashish in the slums of Amsterdam. "Decoding" these skins involved flipping the image upside down, then "unshearing" it by ignoring certain inexplicable black pixels (or relocating them to the end), then flipping the image again.

Unfortunately, further complications seem to have arisen in the texture coordinates for these models. I highly recommend sticking to a texture width multiple of 4 from the very start... even though that isn't possible when generating the skinmap using QME.

If I was a betting man... (which we've established I'm not! :lol: ) I'd say he came up against the occasional upside-down BMP (BMPs allow that, like TGAs) and hacked in something ugly to handle them.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Sajt » Mon May 10, 2010 5:47 pm

Probably. Anyway, I don't think that model works in even DarkPlaces. I did manage to figure out how to decode the skin. If you want the code I could post it. In any case, the code for FixMDL will go up on the QShed SVN one of these days.

The model that I thought you were going to look at was not nofix.mdl, but bomb.mdl. This model was run through QWalk, which resulted in some duplication of vertices (since QWalk doesn't support the old facesfront/onseam Quake texcoord system). I think QWalk must have recalculated the normals after that, which results in hard lighting seams along where the vertices were duplicated. But it looked fine in DarkPlaces for some reason.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Next

Return to Modeling

Who is online

Users browsing this forum: No registered users and 1 guest