Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPSSPP spits out green "stencils" and other abnormal graphic issues in PawaPota games #16331

Closed
5 tasks done
kiiboen opened this issue Nov 4, 2022 · 20 comments · Fixed by #16358
Closed
5 tasks done
Labels
GE emulation Backend-independent GPU issues
Milestone

Comments

@kiiboen
Copy link

kiiboen commented Nov 4, 2022

Game or games this happens in

ULJM-05077, ULJM-05195, ULJM-05300, ULJM-05421

What area of the game

Graphic issues occur in every menu. Some are worse than others.

ULJM05300_00002
ULJM05300_00003
ULJM05300_00004
ULJM05300_00001

What happens

when "Texture Dumping" is turned on on PawaPota 1~4; the emulator spits out strange stencils with transparent parts where the sprite would be. A lot of them are green, but they can also be other colors, such as pink and bright yellow.
09847ce058a963d4b8e3a359
This happens in v1.13.2 and the new git releases I tried out.

In newer versions of PPSSPP (v1.13.2-1748-ge97d5498c), there are also weird display issues where everything looks glitchy and corrupted. This didn't happen in v1.13.2.

What should happen

The dumped textures should not come out as green stencils. Textures dump normally and there are no graphic issues (in both versions I tried) in PawaPota 2011 and 2013.

GE frame capture

No response

Platform

Windows

Mobile phone model or graphics card

Intel(R) HD Graphics 20.19.15.4509

PPSSPP version affected

v1.13.2-1748-ge97d5498c

Last working version

v1.13.2

Graphics backend (3D API)

Direct3D 11

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try changing graphics settings to determine if one causes the glitch (especially speed hacks or enhancements/replacements.)
  • Include logs or screenshots of issue.
@LunaMoo
Copy link
Collaborator

LunaMoo commented Nov 4, 2022

Opened that png and it seems like a normal texture with color data, just those colors are transparent, but games sometimes use such textures, not long ago someone posted compare between PS2 and PSP textures of some game and one of them used transparent textures as well, it's not like textures are images to be seen by human, textures are just data to be processed by the game to show images to then be seen by humans, if the data is there, there's nothing bad in it being invisible to humans.

Here's the same texture file you uploaded with alpha changed to be visible, nothing else changed:
200062233-3f49b3d9-0ff7-41ad-b5b9-322553f1bb15 alpha modded

As for glitches they might as well be driver issues since you don't have/use a dedicated GPU, a frame dump is pretty much a must, especially since those are some very rare/unpopular(at least outside of japan) games.

@kiiboen
Copy link
Author

kiiboen commented Nov 4, 2022

Ohhh, thanks, this was bothering me ever since I started trying to rip textures from the PawaPota games. Can you tell me how to switch the alpha on the dumped textures to be visible? I have PaintDotNet on my computer.

@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Nov 4, 2022
@hrydgard
Copy link
Owner

hrydgard commented Nov 4, 2022

My guess for the newer issues is that we detect render-to-palette/CLUT here, and something doesn't go as planned somehow, since we added GPU-accelerated support for that quite recently. But yeah, would need a GE frame dump to confirm. See https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump

@hrydgard hrydgard added this to the Future-Prio milestone Nov 4, 2022
@kiiboen
Copy link
Author

kiiboen commented Nov 4, 2022

Here's the frame dump (.ppdmp) file in a .zip file.
pawapota3framedump.zip

@kiiboen
Copy link
Author

kiiboen commented Nov 4, 2022

Also, I figured out how to reveal the dumped textures, I found a PaintDotNet plugin. (BoltBait's Transparency v5.2)
pawapta3text

@unknownbrackets
Copy link
Collaborator

The game spends 1-244/347 carefully drawing a background it then proceeds to replace in 245/347, sigh.

For the green, it actually uses a color test of a < 0xFF. 290/347 is the first one (top center) with some green artifacting. It seems like the CLUT was read from RAM, so at least for this it doesn't seem like a rendered CLUT issue (but maybe for the others?) It's using 5551 CLUT, and I seem to recall we had a bug in v1.13.2 where we treated 5551 as 4444 or something in some path, not sure if affecting CLUT usage though.

Texture filtering is nearest/nearest/nearest, and it's using through 16-bit TCs and pos. So ought to be a nice and simple case.

The correct rendering actually has the green bleed in, oops (from a PSP):
#16331_ULJM05300_pawapota_green

If this (the green bleed specifically) doesn't happen on a real PSP, we must have some issue with the CLUT being loaded.


For the text on the right side, I don't reproduce this issue with the frame dump. Might be a setting, like lazy texture caching or some texture cache hash hazard?

273/347 is where it draws the bottom right text. CLUT from RAM, but it does use an offset and mask (0xE0 | (index & 0xF) - it's CLUT4 so the mask doesn't matter), and visually the wrong graphics seem like they're doing this offset wrong. Each of the 256 colors uploaded to the palette are arranged in sets of 16 colors, with the first color set to 255 alpha. However, the glitched rendering in the screenshot seems to be using a different color.

Are you using any of the following settings?

  • Vertex cache
  • Lazy texture caching
  • Retain changed textures

Does this only happen for you using the Direct3D 11 backend, or all? If you open the frame dump you uploaded in PPSSPP (just open as if it was a game), do you still see the issue?

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Nov 6, 2022

Hm, could be related to #12188 ?

@kiiboen
Copy link
Author

kiiboen commented Nov 6, 2022

Okay. I'm really sorry if this is confusing but I just went to go reproduce the glitches in PawaPota 3 and the game appeared normal for some reason, I loaded in the framedump of the main menu and the screen would flash black and kick me out to the main menu. I tried like 3 versions of PPSSPP (v1.13.2-1830-g529df5e19, v1.13.2-1748-ge97d5498c & v1.13.2) and all the backends in the graphic (OpenGL, Direct3D 9 & Direct3D 11) I tried turning Vertex cache, Lazy texture caching and Retain changed textures on and off and I still had no visual problems.

I was using v1.13.2-1748-ge97d5498c when the glitches were occurring, I had Direct3D 11 selected and "Vertex cache", "Lazy texture caching" and "Retain changed textures" all turned off. I checked out the issue with the Digimon game and the glitch in the menu looks similar to what I was experiencing.

@unknownbrackets
Copy link
Collaborator

Do you remember if these glitches were showing up after a playing the game for a while, or just right away after loading the game?

-[Unknown]

@kiiboen
Copy link
Author

kiiboen commented Nov 6, 2022

The visual glitches would occur as soon as game booted up. This is the first thing you see when you boot up PawaPota 3:
ULJM05300_00004
When I was having the issues, Pawapuro-kun looked blue and distorted, I don't have a screenshot of this unfortunately.

@Saramagrean
Copy link
Contributor

Saramagrean commented Nov 7, 2022

glitches is showing up after enable "save new textures" option.

J4-1

and comeback to correct rendering after disable "save new textures" with toggle (enable or disable) "replace textures" option.

J4-2

GE Dump.
ULJM05421_0001.zip

@hrydgard
Copy link
Owner

hrydgard commented Nov 7, 2022

Nice find! So the bug is with save textures. We do things slightly differently in that mode for various reasons, needs some fixing and cleanup.

@unknownbrackets
Copy link
Collaborator

Would've also affected devices without full 16-bit texture support. Very nice find.

-[Unknown]

@Saramagrean
Copy link
Contributor

Try v1.13.2-1875-g87bd7aacc sitll happen. 😅

@unknownbrackets
Copy link
Collaborator

Hm, it was working in the frame dump. Can you double check to make sure you don't have any replaced textures that are now being loaded (it would've created incorrect replaced textures)? Does it happen for you still also using the frame dump?

-[Unknown]

@Saramagrean
Copy link
Contributor

Saramagrean commented Nov 8, 2022

I removed all dump textures before testing and yeah it happen still also using the frame dump (from this).

No weird square glitches on text, just color is wrong rendering.

J3-1

@unknownbrackets
Copy link
Collaborator

Oh, looks like maybe there's still some R/B swap issue, I thought the colors looked better but maybe I moved to the Digimon frame dump too early. Shouldn't be a hard fix if I can reproduce.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Well, I wasn't crazy... unfortunately the color swap is not reproducing for me. Tried NVIDIA and Intel Direct3D 11, as well as Direct3D 9 for good measure.

Proper colors

Texture scaling, no 16-bit formats, and save textures didn't reproduce it. Even having textures to replace didn't either.

Your screenshot is definitely showing R/B swap. If you put PPSSPP in a new folder and try the frame dump, does it still happen? Maybe there's somehow some setting... I didn't find anything.

-[Unknown]

@Saramagrean
Copy link
Contributor

Confirm v1.13.2-1886-ge15efca23 is fixed wrong color rendering on all backends. 👍

@unknownbrackets
Copy link
Collaborator

Really? That's weird, it really shouldn't have changed anything, it was just cleanup. But I'll take it, I guess.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants