Project

General

Profile

Actions

Emulator Issues #3376

closed

Paletted textures are dumped multiple times when TLUT changes

Added by mattcallaghan over 13 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
GFX
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

What steps will reproduce the problem?

  1. Dump a texture (in Wind Waker)
  2. Replace texture
  3. Boot Wind Waker
  4. Change area
  5. Same texture has different name, and so does not get loaded.

What is the expected output? What do you see instead?
For me to replace a texture and have it load whenever it gets called. Weirdly, the textures also have different names when they are viewed both in game and in menu, so say you have one texture for when you recieve the telescope, one texture for when you look at the telescope in menu and one for when you attach it to a button (all of these texture names change for each area in the game).

Dolphin version with the problem? Other Dolphin version without the
problem?
I had this problem in r6277 and now that I've updated to r6294, every single texture has changed names again...

32-bit or 64-bit and any other build parameters?
64-bit. Probably 32-bit aswell though.

OS version and versions of tools/libraries used?
Windows 7 64bit, built with VS2008, using the DX9 plugin.

Please provide any additional information below.
There's a Wind Waker texture pack that you can use for testing here:
http://cid-9cd27aa5d866d5fc.office.live.com/self.aspx/.Public/Wind%20Waker%20Texture%20Pack%20v2.rar
It should work as long as you have the US version of the game, are using r6277 and the moons have aligned correctly :P

This problem seems to occur because texture names seem to be based off memory address or something, and I suppose textures will not always be saved in the same place of memory. Maybe textures could be named after a checksum or something?

Actions #1

Updated by skidau over 13 years ago

Please check if r6308 has fixed this problem. Hopefully the texture names are now stable after r6308 (they may not be the same as they were in r6277).

Actions #2

Updated by NeoBrainX over 13 years ago

Are those really the same images or do they differ in some pixels?

Actions #3

Updated by mattcallaghan over 13 years ago

As far as I can tell, they're exactly the same. They're even the same resolution and size. The only difference seems to be that they're loaded when in different areas.

I realised that I hadn't updated to r6308, for some reason I assumed I did (and deleted my last post). Anyways, updated and rechecked that the issue was still occurring and it is unfortunately.

I'll just repeat what I said in the post I deleted. I don't mean to sound naggy, I understand that enhancement games isn't as high priority as fixing games. I'm not used to posting issues, and am not entirely sure how to do it while sounding duly appreciative.

Actions #4

Updated by NeoBrainX over 13 years ago

fwiw, I should have maybe asked for the filenames as well...
could you e.g. post the filenames of those 5 textures?
(and please don't delete comments, that really can be confusing sometimes :P)

Actions #5

Updated by mattcallaghan over 13 years ago

Heh, sorry. The telescope images are:
GZLE01_22ed04ad3094341a_9.png
GZLE01_a92160299028438c_9.png
GZLE01_75032d3ddbab32fa_9.png
GZLE01_ad1debad086075b7_9.png
GZLE01_b885588892e78bd1_9.png

But there's plenty of images that have duplicates. Any holdable item and button icons seem to do it. Oh and looking through, even stuff like floor textures.

Actions #6

Updated by NeoBrainX over 13 years ago

hm, that string between the underscores is the texture hash, i.e. apparently the texture do seem to be different.. at least to Dolphin.

Fwiw, you DO delete the old textures when retrying, right?
And... what happens if you enable/disable safe texcache and try the different accuracy levels?

Actions #7

Updated by mattcallaghan over 13 years ago

Yeah, I am deleting Zelda's dump folder each time.

Hadn't thought of changing Safe Texture Cache settings but it's the same (I had it set to normal), I've now tried it with it off, set to "safe" and "fast". I made sure to restart Dolphin after setting the Safe Texture Cache mode aswell, since I couldn't remember if that was required.

I'm seriously considering looking through the textures pixel by pixel to see if there's a difference right now, but I just don't see that being the case. I didn't realize Dolphin was using a checksum before, but I now I do, I can see why it's weird, because I'm pretty certain that they're not different files. Otherwise, for some reason, Nintendo have a different texture per game area, for pretty much every texture used in the game (I mean, that would be a huge waste of disc space).

Actions #8

Updated by NeoBrainX over 13 years ago

You could as well just run some diff tool over the files to check them for differences.

Actions #9

Updated by mattcallaghan over 13 years ago

Oh, just noticed that the filenames are different when changing Safe Texture cache modes. When Safe Texture Cache is set to normal, the main Zelda logo on the main screen is:
GZLE01_b29da1059c232166_9.png

On fast:
GZLE01_409dc39a2f577178_9.png

On safe:
GZLE01_f7313ee6b3794f9a_9.png

Off:
GZLE01_f7313ee6b3794f9a_9.png

Actions #10

Updated by mattcallaghan over 13 years ago

Tried comparing the files in WinMerge (googled for "diff tool" :D ), according to that "The selected files are identical".

Actions #11

Updated by baby.lueshi over 13 years ago

@mattcallaghan The original way I implemented hires textures was saving them based off the safe texture value, so I guess when different versions of safe texture were put in, they didn't think of hires textures using it.

I guess we could force the use of a specific level for safe texture hashes when hires textures are loaded, but I'm not sure of the effect on performance/accuracy this will have.

Actions #12

Updated by skidau over 13 years ago

  • Category set to gfx
Actions #13

Updated by school.player about 13 years ago

I know this is old, but if you are loading hi-res textures, you probably have performance to spare.

Actions #14

Updated by mattcallaghan over 12 years ago

So I was curious if this still happened and if I could figure out a few more details about it.

It doesn't happen with all textures, it seems to just be the GUI textures (the ones I was wanting to replace) and seemingly a few random other textures.

I didn't fully trust the diff tools that I used since they all seem to prefer proper text files, so I made a super quick and dirty diff tool for checking the RGBA values of image files, and in that way at least, the images are identical.

Just wondering if I should close this now really, since it apparently only affects one game, and only some of the textures.

Actions #15

Updated by NeoBrainX about 12 years ago

The filenames indicate that this only affects paletted textures ("_9" = GX_TF_C8).

The different filenames come from the fact that those textures use a different texture lookup table (tlut). The filename is using the format gameid_texhash_format, but paletted textures get their texhash XORed with the hash of the current tlut.

A proper fix for this would be what texcache-rewrite did: Don't decode and depalettize textures at the same time, but separate the steps; texture dumping would only dump the decoded texture to disk then. However, this would probably break existing hires texture packs which use paletted textures.

Actions #16

Updated by Billiard26 about 11 years ago

  • Issue type set to Bug
Actions #17

Updated by frozenwings almost 11 years ago

Could you add in a "only dump the decoded texture to disk" check box option?

Or would an option such as that be impossible or extremely difficult to implement?

Actions #18

Updated by MayImilae over 9 years ago

  • Status changed from New to Accepted

This has been confirmed by tons of people, so why hasn't this been accepted before now?

Actions #19

Updated by degasus over 9 years ago

  • Status changed from Accepted to Fixed

fixed in 4.0-5234

Actions

Also available in: Atom PDF