marco-calautti / Rainbow

A texture format converter for different consoles' graphics formats.
GNU General Public License v2.0
81 stars 8 forks source link

[Request] Add support for TM2/TIM2 files from Kelly Slater’s Pro Surfer #19

Closed bartlomiejduda closed 3 years ago

bartlomiejduda commented 3 years ago

Hello. I have extracted some TM2 images from Kelly Slater’s Pro Surfer, but it seems that they are not supported in Rainbow. I can view them without any issues in OPTPiX iMageStudio https://i.imgur.com/1revGoN.png

I want to ask you for support with scanning and viewing these files in Rainbow.

I am attaching some sample files for analysis https://drive.google.com/file/d/1ql4ScBZsSeecbsaSKoWG9y7W-NAGQ6vg/view?usp=sharing

marco-calautti commented 3 years ago

What is the error message you get from Rainbow?

bartlomiejduda commented 3 years ago

@marco-calautti It is "Illegal bit depth!"

marco-calautti commented 3 years ago

Do all files give this error?

marco-calautti commented 3 years ago

I had a look at your files, and it seems they are of a different version than the ones supported by raimbow. The format is essentially the same, with the exception that the main header seems to have additional padding bytes. All the tm2 files I came up with, which are version 0004 use only 0x10 bytes for the main header. Your files, which are version 0104 use 0x80 bytes for the main header. So, for the time being, you can open your tm2 files, and remove 0x70 bytes starting from address 0x10. Then, the file should open in Rainbow just fine. When you edit and save again the tm2, you should add back the 0x70 bytes you removed, and the game should read your files just fine.

I will try adding support to this version in the next week.

bartlomiejduda commented 3 years ago

@marco-calautti Ok, thank you. :)

marco-calautti commented 3 years ago

Can you please try this new build, and see if everything works? https://www.dropbox.com/s/tzfosqzbifqieo4/rainbow_win32_bin_dev.zip?dl=1

I had to change a bit the xml data, when exporting the new tim2 files. So, if you already exported them, you should export them again with the new version.

bartlomiejduda commented 3 years ago

I have tested it and now all samples are loading fine I think.

The only difference I noticed is with alpha channel in KS_W_LLEG.TM2 https://i.imgur.com/PkuY38r.png It shows up differently in OPTPiX and in Rainbow. And after extraction it seems to be a little darker https://i.imgur.com/yc38dCd.png

Should this sample look this way?

marco-calautti commented 3 years ago

The thing is simply that rainbow uses a checkerboard background and the transparent image appears lighter than optics. Since the image is half transparent, how dark or light the image appears depends on the background your image viewer is using. I think irfanview uses a black background. You can try playing with the background color in Rainbow, and should be able to see how the image appearance changes.

there is nothing wrong in how Rainbow deals with transparency.

marco-calautti commented 3 years ago

If you don’t care about transparency, you can remove the alpha channel from the png with photoshop, or something similar.

bartlomiejduda commented 3 years ago

Oh, ok. I understand now. So for me everything is good with this new build. :) Thanks for fixing this.