gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
771 stars 179 forks source link

Banjo-Kazooie: Some textures from texture pack not loading in Mupen64Plus #2798

Open TheEarthrise opened 1 year ago

TheEarthrise commented 1 year ago

Some textures in Banjo-Kazooie are not loading with Mupen64Plus GlideN64, but they do in Project64 GlideN64. Settings are all the same. I dumped the textures to see what's going on, just to find out that all textures that are not loading have the same name and therefore get overwritten while dumping them.

Mupen64Plus: banjo-kazooie-000

Project64: banjo-kazooie-001

Another texture pack on Mupen64Plus, same problem: banjo-kazooie-002

Jj0YzL5nvJ commented 1 year ago

mupen64plus/mupen64plus-user-issues#730

weinerschnitzel commented 1 year ago

Interesting... Those are jpeg textures? I recall behavior with textures missing with neutered rsp plugins without the jpeg decoding (zelda bgs) but not the text in banjo...

I guess performing bsmiles modification to HLERSP would tell the tale.

Or you could try one of the HLERSP plugin ports to pj64 spec and see if it shows the same issue as mupen64plus. I did one before but I think rosalies is most recent.

That would confirm the same HLERSP bug.

Or try cx64 rsp with both. Theory would be it is correct in both emulators with cx64.

If this does not pan out, has to be a different issue.

TheEarthrise commented 1 year ago

I have done some further testing as suggested. First, I tried RMG with all the RSP plugins it ships with (cxd4, parallel and hle). All show the same result as shown above. Then I tried cxd4 and hle in Project64, again everything remained the same, means in PJ64 all textures were loaded fine, regardless of the RSP plugin chosen.

GhostlyDark commented 1 year ago

Banjo-Kazooie does not use JPEG backgrounds. This has nothing to do with the RSP plugin.

Different textures are dumped as the same file, which happens in other games like Super Smash Bros. (pixel style font) or Resident Evil II (various pixel style fonts), which makes it impossible to retexture them. Some texture dumps also differ between PJ64 and mupen64plus (maybe 32-bit vs. 64-bit?), which shouldn't be the case, yet it happens.

https://github.com/gonetz/GLideN64/issues/2317

Jdbye commented 6 months ago

I have been struggling with what I believe is the same bug. I use Project64 though. I'm trying to dump all the textures in order to AI upscale them, but some textures are dumped with the same filename.

I have reason to believe there is an issue with the file naming of dumped textures. For most textures, there doesn't seem to be any issue, but for the Jinjo textures in particular, the issue is quite obvious.

Let's use the uncollected Jinjo texture as an example for simplicity, since this texture can be dumped as soon as you enter Mumbo's Mountain, and it's a single frame as opposed to the animated texture of collected Jinjos. The issue is the same for both collected and uncollected Jinjos though. GlideN64 dumps this texture, regardless of which color Jinjo it is, with the filename Banjo-Kazooie#2002F1E0#0#0_all.png. Whatever color Jinjo was last collected ends up being dumped with this filename, overwriting whatever was there. Trying to use this as a texture pack results in all Jinjo icons on the pause screen being the same color.

Looking at the completed texture pack by Nikachu, we can see that each color Jinjo does have a different file name: Banjo-Kazooie#2002F1E0#0#0#EFD590DB_ciByRGBA.png Banjo-Kazooie#2002F1E0#0#0#4AB2AF7E_ciByRGBA.png Banjo-Kazooie#2002F1E0#0#0#9E89C4B2_ciByRGBA.png Banjo-Kazooie#2002F1E0#0#0#488F816F_ciByRGBA.png Banjo-Kazooie#2002F1E0#0#0#36C339AA_ciByRGBA.png As you can see, the filenames are mostly the same. But they have an additional identifier (whether it's a hash or something else, I do not know) which seems to be a common trait of the files with _ciByRGBA suffix, and it is this additional identifier that gives them unique filenames. It appears that GlideN64 is incorrectly dumping this in the "all" format (whatever that means) when it should be dumped in the "ciByRGBA" format (as is the case in the pack by Nikachu I'm using as a reference) as the latter would avoid the issue. There is a mix of both types in the texture dump, as well as Nikachu's pack, but for certain textures it seems to use the wrong type. GlideN64 is able to load Nikachu's texture pack fine and the Jinjos appear correct, so it seems like whatever this issue is, it only affects dumping, not loading.

GhostlyDark commented 6 months ago

To visualize the issue described above:

GLideN64 dumps image

Rice dumps image