hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
10.78k stars 2.12k forks source link

Gekka no Yasoukyoku (SotN) ULJM05287 Software rendering oddities #17220

Open RokkumanX opened 1 year ago

RokkumanX commented 1 year ago

Game or games this happens in

ULJM05287

What area of the game

This happens on screens with visible skies such as the Entrance, Olrox Quarters and the Castle Keep. Also the Fire Demon/Flame Demon only appears in the inverted Alchemy Laboratory.

What happens

The Entrance: SotN Entrance Software

Olrox Quarters: SotN Olrox Quarters Software

Castle Keep: SotN Castle Keep Software

Fire Demon/Flame Demon: SotN Fire demon Software

What should happen

This is a screenshot of the inverted Entrance sky and it appears not to have the checkered pattern, at least not to the naked eye and that is somewhat of what I'm expecting the rest of the skies to look like:

SotN Inverted Entrance Software

Without playing the PSX version, this was the fastest source of how the death animation for the Fire Demon/Flame demon would look like:

https://www.youtube.com/watch?v=4MaqpJYTM-c&t=102s

GE frame capture

This is the GE Frame Dumps from the Castle Keep and Olrox Quarters where the checkered skies are present all time. GE Frame Dumps.zip

As Alucard mentioned in the screenshot above, the death animation of the Fire Demon/Flame Demon is so quick I'm not sure it's possible to get a Frame Dump.

Also, again the game is verified 100% here http://redump.org/disc/24765/

HashCalc

Platform

Windows

Mobile phone model or graphics card

NVIDIA GeForce GTX 1070

PPSSPP version affected

v1.14.4-1178

Last working version

Don't know unfortunately

Graphics backend (3D API)

OpenGL / GLES

Checklist

unknownbrackets commented 1 year ago

I'll look at these later, but the checkering could be dither and we'll just have to see how it lines up with a real PSP. Maybe there's something slightly off still about how the dither pattern is applied.

For the death animation, the way I've usually captured things like that is using the Windows GE debugger:

  1. Debug -> GE debugger
  2. About when you kill the enemy hit "Step Frame". It can be hard to catch, using alternate speed 25% could help. The goal is to catch before the death animation, you don't have to hit exactly on it.
  3. Hit step frame until the glitch is about to be visible next frame. I usually use save states / rewind to try again if I miss this.
  4. Hit "Record frame" when the next frame is going to show the glitch (whether or not the current one is.)

It's a bit of a pain but it's definitely possible. It's really about as hard as getting a screenshot of it.

-[Unknown]

RokkumanX commented 1 year ago

Thank you for the quick feedback!

I'll try what you suggested.

unknownbrackets commented 1 year ago

Hm, for the checkered pattern, here's the second frame dump's PSP image: #17220_ULJM05287_sotn_checker2

And software rendering: #17220_ULJM05287_sotn_checker2_software

There's some accuracy issues with the moon and a few other elements, but the dithering looks right. Vulkan and other hardware backends of course don't do any dithering, so they look different.

However, the screenshots you provided had "lines" in the checkering, which looks wrong. That's just because the display/screenshot has been resized to an unclean multiple of the PSP's resolution. So I don't think that's an issue.

The dithering is correct, and just (intentionally) missing in hardware rendering. The reason is that hardware rendering always forces things to 8888 (true color) as much as possible. Because of this, you typically don't get banding or other artifacts, but sometimes colors come out brighter or darker than they should have by a little bit. It's a pretty worthwhile tradeoff.

On the real PSP, graphics were often drawn using 5551, 565, or 4444 color depths. In a gradient, you can often clearly see banding in such a gradient. Since they didn't have the memory (and memory bandwidth) to use 8888, PSP games instead used an old technique called dithering. This intentionally does a checker matrix (exactly like you see in my above screenshots) to "interrupt" the banding. Although this doesn't look as good as true color, it looks better than not doing it.

Most games used dithering a bunch, actually.

-[Unknown]

hrydgard commented 1 year ago

Extremely minor technical correction to the above, though I'm guessing you just left it out for simplicity - dithering is not really old, it's a timeless technique thats actually still used in modern games with HDR rendering when converting to SDR display, can still get rid of banding in that situation! Usually larger blue noise textures are used these days instead of a small repeated matrix. Dithering is also used for audio bit depth reduction.

These days visual dithering is not as visible as the aggressive dither-to-16-bit color that was done on the PSP and Voodoo 2 for example though!

unknownbrackets commented 1 year ago

Heh, I did mean old as in timeless - but I didn't actually know dithering was used for audio as well (makes sense, of course.)

-[Unknown]

RokkumanX commented 1 year ago

Thank you both for your input in the matter.

Would playing on a 48" inch TV be the reason to why you can see the checkered pattern so clearly?

unknownbrackets commented 1 year ago

I mean, that would definitely make it look more visible, I'd think. But if you have it upscaling using a bilinear filter or some other screen scaling filter, it'd probably become less noticeable.

-[Unknown]

hrydgard commented 1 year ago

Try the new integer scaling option in Display layout & effects, just to make sure it's not some moire effect from scaling.

LunaMoo commented 1 year ago

C:SotN doesn't render 1:1 anyway since it's stretching PSOne res to match the PSP res, the game itself only allows to stretch or unstretch to/from widescreen, but it's always stretched unless a cheat like the one I made for EU version to render it with 1:1 native res is used.

Edit: I checked EU version same issue, althrough in different ways both PSP and PPSSPP get it wrong due to stretching that messes up the pattern in the PSP port of the game. With my 1:1 render resolution patch for this game the pattern looks right and doesn't create any visible lines, but I only ever made it for EU version.

RokkumanX commented 1 year ago

Thank you all for your input, for the last two days Alucard have been standing in the inverted /Black Marble Gallery killing endless and endless of Medusa heads leveling up to 99 and the Muramasa attack to 999.

He's up to 990 right now and tomorrow I can finally try out the new integer scaling everywhere in my hunt for a complete beastiary with all item drops.

The integer scaling looks really good but I haven't seen any skies with it yet.

I'll report back tomorrow.

RokkumanX commented 1 year ago

Well, it seems like the checkered pattern is still present with integer scaling enabled.

Game looks really good otherwise and everything is scaled properly.

This issue isn't super important as the game is more than completable without any game breaking bugs/glitches.