Page 5 of 5

Re: MW2 textures

Posted: Fri Jan 23, 2009 11:40 am
by Col.Kell
You're good.... :)

Re: MW2 textures

Posted: Wed Jan 28, 2009 11:37 pm
by Skyfaller
I don't have as much time for this as I would like, so I haven't been able to work some bugs out yet, but I can post a first few pics. Still working on this, so there may be better screenshots later.

In the cases where it doesn't work yet, I am loading the right textures, but they are applied to the wrong places.

Every different palette gives a completely different set of texture colorations, so there are very many possible skins for each mech.

Re: MW2 textures

Posted: Thu Jan 29, 2009 7:51 am
by Col.Kell
Great job! Mechs look far better than the traditional plain white. Makes them look more fierce too.

Re: MW2 textures

Posted: Sat Jan 31, 2009 2:32 am
by Skyfaller
Some notes:
  • Palette entries must be multiplied by 4.
  • Texture coordinates are not negative, but may exceed the size of the texture. In that case, the texture must be placed several times.
Texture coordinates exceeding the size of the texture require that the texture is placed several times in the texture atlas.

Re: MW2 textures

Posted: Sun Mar 08, 2009 1:07 pm
by Skyfaller
For efficiency reasons, I use a single texture for an entire mech. This reduces the number of GL calls to select textures, but it is not compatible with MW2 and MW3m which use individual textures for each polygon. As a workaround, I compile the small textures used by a mech into one large texture, called a texture atlas. This worked well for MW3, but MW2 uses texture coordinates that exceed the texture size to indicate that a single texture should be placed several times. I have been able to fix that placing textures several times in the atlas when needed. This fixes some rendering bugs, but there still appears to be a problem with the texture coordinates. I'll keep you updated.

Re: MW2 textures

Posted: Wed Aug 26, 2020 9:31 pm
by Kallisti
Ancient Spirits of Evil, transform this decayed thread into MUMTHREAD. The Evah Living!
Image
Skyfaller wrote: Sun Jan 18, 2009 7:05 am 31stCC (3DFX, Matrox, ATI): .555 format
...
The .555 textures, like the .XEL files, have a header consisting of only horizontal and vertical size. Judging from the size, the file contains 16-bit for each pixel, red, blue, green and alpha channels. MW3 uses a different format with the same name.

(Currently working out the exact format for the .555 files, will update post after that)
Ok, I didn't see this posted anywhere and this seems to be the best thread for it without starting a new one... For those who are interested, someone suggested that for the Mech2 engine that my son and I are working on, that we roll support for the 3DFX version of the game... We got the textures and and meshes going pretty easily.

So... to contribute to the collected knowledge...

The 3DFX version's .555 textures are in fact 555 textures, at least as long as they're opaque, anyway. The transparent ones are 4444 textures.

So here's how this breaks down.
The opaque textures take 5 bits per channel, for a total of 15 bits. The 16th bit is discarded but could presumably be used for an alpha cutout. They're formatted as BGR, not RGB as would be expected. So bits 0-4 are Blue, bits 5-9 are Green, bits 10-14 are red. Divide the results for each channel by 31 or 31 to get the end result as a normalized float. Multiply the normalized float by 256 to get the full RGB value if you're not using normalized float based color vectors like we are.

The 4444 transparent textures are very much the same, except it's bits 0-3 for blue, 4-7 for green, 8-11 for red, and 12-15 for alpha. The divisor for this is 15 instead of 31 on each channel to get the normalized float. The rest is the same as the 555 opaque textures.

Here are a few examples of my MW2 3DFX .555 file decoding code at work:

Image
Image
Image
Image
Image