textures2quake: Takes high res textures --> Quake/Half-Li

Discuss anything not covered by any of the other categories.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

textures2quake: Takes high res textures --> Quake/Half-Li

Post by Baker »

Image

Humble home page for it:

http://www.quake-1.com/docs/textures2quake

Download: textures2quake v1 (alpha; not tested on another computer ... should run I hope; 15 MB because it includes some Nexuiz textures to do an easy test)

Takes high resolution textures (Quake3 for example) and scales down 50%, sizes to them power of 2 (GLQuake only supports power of 2 textures) and makes 3 sets available:

1. 24-bit color versions
2. Quake paletted versions
3. Half-Life style: 256 color independent palette

Renames all textures to max length 15 because WAD2 and WAD3 only allow 15 characters in a texture name. Stores a log of those renames in a tab delimited file.

Supports using some other palette instead of the Quake palette, like say the X-Men Ravages of Apocalypse palette. Palette must be in JASC-PAL v 0100 format ... the palette format used by Paintshop Pro.

Only supports conversion from a single folder. Copy all the textures to a single folder to do a multifolder conversion. Source included in zip (uses FreeImage library).
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

can i upload this to moddb? - ill upload the later versions too
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

ceriux wrote:can i upload this to moddb? - ill upload the later versions too
If you want to ... barring an unexpected problem this tool might be final state as it is.

I made it with the idea of quickly converting GPL textures like Nexuiz or Open Arena or other similar projects into a Quake friendly format with replacement texture support as an automatic.

Although a tool like this would have likely made something like JPL's conversion of Doom 3 texture set to Quake from a "project" into a 15 minute whim :D :D
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
goldenboy
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel
Contact:

Post by goldenboy »

I wonder how many people will follow the advice about using Tex Mex or another texture editor if you're not happy with the conversion's quality.

I wonder how many potential users will even understand that. Not to mention read it.

The tool is a two-edged sword, as we say here.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

goldenboy wrote:I wonder how many people will follow the advice about using Tex Mex or another texture editor if you're not happy with the conversion's quality.

I wonder how many potential users will even understand that. Not to mention read it.

The tool is a two-edged sword, as we say here.
Notes are always for the smart ones so they know what a tool is doing. Everyone else won't care because it is "click a button" easy.

The "pros" are the ones that ask questions and wonder things like why did this one texture resize to 64 x 32 instead of 48 x 32, etc.

The palette reduction is so good that it is probably better than any tool out there and might be better than the palette reduction in Paintshop Pro or Photoshop. I was kind of surprised.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

If you are converting Doom3 to Quake textures, I hope that you are baking the normalmaps and specular onto the diffuse with front-on lighting. The Doom3 diffuse textures are basically a couple of bland solid colours each.

And as for the palette reduction, you're taking fullbrights in mind right? I'm pretty sure that TexMex sucked because it would indiscriminately use fullbrights in the mipmaps it generated. But it's been 8 years since I've used TexMex (not that there are new versions since then, I'm pretty sure the author died of cancer a long time ago).

How is the palette reduction better? You're not doing dithering or error diffusion, are you? (That's uglier.) Otherwise you're doing "nearest colour matching", and there's only two ways to do that: Simple arithmetic, and with luminosity weighting. I'm pretty sure PSP uses the former. I wonder if the latter would look better.

I would download this but 15MB is too much for my limited bandwidth. Maybe you should make a minimal download without sample textures.
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.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

For fullbrights it's not actually 100% safe to assume that palette range 224-254 is the one to use. These are used alright by the Quake palette, and I'm pretty sure by convention elsewhere, but the fullbright range is actually defined by the colormap and can - in theory - be present anywhere within the palette (and does not even need to be a continuous range).

255 is always safe for alpha though.
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
Spirit
Posts: 1065
Joined: Sat Nov 20, 2004 9:00 pm
Contact:

Post by Spirit »

This is fantastic. Thank you so much.

I do not care how the Quake'd textures look like. If someone wants high quality then manual work is needed in any case.

But to make high resolution texture sets Quake-compatible, this is great. The converted ones are just for mapping, ingame you have the full quality replacements.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

mh wrote:255 is always safe for alpha though.
unless its conchars.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

Spike wrote:
mh wrote:255 is always safe for alpha though.
unless its conchars.
Or sky, for that matter.

Dontcha just love wacky non-standard Quake formats?
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
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

Sajt wrote:And as for the palette reduction, you're taking fullbrights in mind right?
The palette reduction doesn't actually use the fullbrights. So it is reducing it to the 224 non-fullbright colors. It says this in the little conversion log panel.
How is the palette reduction better? You're not doing dithering or error diffusion, are you? (That's uglier.) Otherwise you're doing "nearest colour matching", and there's only two ways to do that: Simple arithmetic, and with luminosity weighting. I'm pretty sure PSP uses the former. I wonder if the latter would look better.
It uses the Xiaolin Wu algorithm from FreeImage ( http://freeimage.sourceforge.net ) and I really have no clue how it works except the reduction is so good looking I needed to convert some green textures to make sure my eyes weren't deceiving me.
I would download this but 15MB is too much for my limited bandwidth. Maybe you should make a minimal download without sample textures.
I'll make a minimal one.

Something I forgot to say, you can drag drop a texture into the "directory textbox" to specify the folder.

Add: the download without the samples folder - 681 KB - http://www.quake-1.com/docs/textures2qu ... amples.zip
Last edited by Baker on Thu Jan 21, 2010 11:11 pm, edited 1 time in total.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Teiman
Posts: 311
Joined: Sun Jun 03, 2007 9:39 am

Post by Teiman »

I wish carmack made textures with fullbrighs use a magic name like uglyredwall_fb to able to use the full palette for everything else.

*sakes fist at carmack*
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

Resampling quality and palette reduction quality illustration. Looking at these, you'll see why I didn't quite believe the Quake ones at first.

Nexuiz original texture:

Image

"Low-Res 24 BPP" original texture (50% size reduction):

Image

Half-Life style 8 BPP (256 colors palette reduction):

Image

Quake Palette version - 256 colors locked to Quake palette [well actually 224 colors because I stripped out the fullbright color rows in the tool]:
Image

The above image doesn't contain any Quake-adverse colors like bright green, but as you can see the conversion quality in palette reduction is outstanding (Thanks Xiaolin Wu for the algorithm (source) that happens to be incorporated into FreeImage!).

Now ... the nice advantage of the above process is that you can make a map with the Quake textures and toss the "high resolution original textures" from the "high-res" folder into "quake\id1\textures" folder as replacement textures.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

That "Radioactive" image is probably the worst possible test subject. It will look almost the same no matter what algorithm you throw at it. You should pick something with actual gradations of colour, with all sorts of hues involved. That's what that algorithm seems to be tailored for, anyway. I'm interested in what results a "creative" algorithm (as opposed to simply "accurate") would actually have.
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.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

Sajt wrote:That "Radioactive" image is probably the worst possible test subject. It will look almost the same no matter what algorithm you throw at it. You should pick something with actual gradations of colour, with all sorts of hues involved.
Nexuiz was my test subject and most of those textures are rather gray and black and white, really. So here is some random photo off the web with a lot of color in it ....

"Low-Res 24 BPP" original texture (50% size reduction):

Image

Half-Life style 8 BPP (256 colors palette reduction):

Image

Quake Palette version - 224 colors:

(Quake Palette didn't a stand a chance with the blue ....)

Image
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Post Reply