Talk:TEX0 (File Format)

From Custom Mario Kart
Jump to navigation Jump to search

TEX0 questions

Hi chadderz, it's me again ;)

Can you (and all others) please tell me more details about tex0 file. I have found the thumbnails and can guess some geometries. But I don't know why and when they appear. Is there something in the 'unknown header?

The images itself seems half and quarter and ... of the main image, but they are not exact thumbnails.

Wiimm 22:49, 26 June 2011 (CEST)

I had run a statistical analysis through all TEX files in MKW and now its clear (see article). My tools can export all images now. Some more analysis will follow.
Wiimm 15:54, 27 June 2011 (CEST)
Hi, you seem to have everything correct, but they're mipmaps not thumbnails. I've updated the article to reflect this.
Chadderz 09:31, 28 June 2011 (CEST)
Ok, mipmap is the name I didn't know, but I have already guessed the function of the mipmaps.
Why have you removed my value table for offset 0x14 and what do you mean with " The number of mipmaps-1 (single)". Perhaps, if there is one minimap, the value is 0x3f800000 for all tex files. And the other values are also valid without any exception. I have scanned about 30000 tex0 files of all szs files of MKW.
Wiimm 16:23, 28 June 2011 (CEST)
I've corrected the slight typo, should've been number of images-1 (single). What I mean is that the it is the floating point (single) representation of the number of images-1. 3f800000 is 1.0f, 40000000 is 2.0f, etc. Your values match exactly.
Chadderz 18:04, 28 June 2011 (CEST)
Now I understand the meaning of "(single)"
Wiimm 18:44, 28 June 2011 (CEST)

General image questions

  • I have found images in TPL, TEX and BREFT-subfiles. Are there more file formats with images?
  • I have found the image formats with palettes only in TPL files. Have you any palette experience with TEX and BREFT-subfiles?
  • Now I know about mipmaps in TEX0 files. What's about the other file formats?
I have found mipmaps in 2 BREFT subfiles.
Wiimm 16:15, 30 June 2011 (CEST)
There is one TPL file with 2 images, but not a mipmap. Now I'm playing Delfino Island‎.
Wiimm 15:54, 1 July 2011 (CEST)

Tests with Six King Labyrinth

Some more info

The I have made some experiments with Six King Labyrinth. I have modified all TEX0 files in different ways (takes less than a half second for 162 TEX0 files).

  • CMPR converted to RGB5A3 → nothing happens
  • Removed all mipmaps → far away textures looks bad.
  • Exact one mipmaps → far away textures looks a little bit better.
  • Up to 10 mipmaps for each image → can't find a difference to the original track.

I used Six King Labyrinth to find out if the Slow Motion Bug is changed — it isn't.

OK, everything in order
  • Yes, as mentioned on the image format article, BTIs do. I've just remembered that BRFNTs do too.
  • No, I've only seen palletes in TPLs, and not many of them. It wouldn't suprised me if the others have support some how, it's just never used. I'm sure some experiments could attempt to find that.
  • No, I've only seen mipmaps in TEX0s, as they're the only ones that are likely to shrink and grow by large factors during time critical rendering.
As far as SKL is concerned, The RGBA5A3 will be bigger, but yes there should be no difference (quality could be higher though). Far away textures must be an aproximation of a near texture, and since the Wii compromises to get speed, it doesn't do a good job of this. The more mip maps you have, the better the aproximation will be, as it already has a value that is close to the truth. I'm not suprised it didn't affect the slow motion, because it's not a graphics card slow down (that I'm aware of), so speeding up the render shouldn't help particularly.
Chadderz 23:36, 28 June 2011 (CEST)
Please read this. Reducing the images may be a solution.
Wiimm 22:40, 29 June 2011 (CEST)

How are the bytes arranged within the image data section?

For 32bits per pixel, how are the color channels arranged? Is it all color channels for the first pixel for the first block, then all color channels for the second pixel of the first block, etc? Or is it all reds for all the pixels of all the blocks? Then all greens for all the pixels for all the blocks, then same with all the blues, and finally all the alphas? Or are all the RGB values handled first, and then a separate section for all the alphas? Please explain.

Videogamer555 (talk) 23:14, 12 September 2013 (UTC)

The first sentence says:
And Image Formats explains it.
btw: You can use my tools to convert the images to PNG and back.
Wiimm (talk) 13:33, 13 September 2013 (UTC)