ppsspp icon indicating copy to clipboard operation
ppsspp copied to clipboard

Kurohyou Ryu Ga Gotoku Shinshou (Yakuza) - No clipping of 3d characters behind backgrounds based on depth within screen.

Open SausageDog opened this issue 8 years ago • 40 comments

Kurohyo uses 2d backdrops with 3d characters rendered on top of them. PPSSPP does not clip the 3d model when they are "behind" objects in the 2d background. Tested on PPSSPP 1.4 but has not worked on previous versions of the emulator either.

The attached screenshot shows the character floating in space in front of some cupboards instead of being hidden behind them.

npjh50333_00000

SausageDog avatar Apr 09 '17 02:04 SausageDog

Does this work on any backend (such as Vulkan)? Is it the same broken on all 4 backends?

Also - if you try the software renderer (it will be slow), does it render properly there?

Is there a way to get this to happen in the demo?

-[Unknown]

unknownbrackets avatar Dec 24 '17 16:12 unknownbrackets

All backends render incorrectly, including OpenGL, D3D9, D3D11, and Vulkan, tested on PPSSPP version 1.5.4.

I tried the software renderer with the OpenGL backend, and it renders correctly with the characters correctly obscured by the foreground geometry in the scene. Screenshot shown below.

I don't have a copy of the demo for this game so I can't say if it works in that or not.

npjh50333_00000

SausageDog avatar Dec 27 '17 05:12 SausageDog

Interesting. I wonder if this game is downloading depth - I seem to recall it was doing that in other places for effects at the start of fights (we currently don't render those effects properly.)

-[Unknown]

unknownbrackets avatar Dec 27 '17 07:12 unknownbrackets

Since the background is prerendered, it seems more likely that it's uploading a depth buffer, similar to how Star Ocean uploads a stencil buffer. We don't currently initialize depth buffers with contents of the VRAM where they are created, and we don't detect block transfers to them. Maybe the latter would catch this, that would be convenient.

hrydgard avatar Dec 27 '17 08:12 hrydgard

Is there an easy way to upload depth? I guess it ought to be doable on Vulkan...

-[Unknown]

unknownbrackets avatar Dec 27 '17 08:12 unknownbrackets

Yeah, you can output depth from a fragment shader, like we do with our pixel depth rounding hack. So you just need to upload the depth as a texture (depth or single-channel color, whatever) and draw a single quad writing the sampled texture to gl_Depth or whatever the output is called.

This is doable in all backends except D3D9 and GL with versions < 3. For those, I guess you could convert the texture to a dense triangle mesh with the correct depths but not really worth bothering with...

hrydgard avatar Dec 27 '17 08:12 hrydgard

This issue persists in the latest version of PPSSPP - ppsspp-v1.8.0-585.

JimsAlliance avatar Aug 29 '19 22:08 JimsAlliance

Still not fixed.

dante3732 avatar Jan 22 '21 17:01 dante3732

Thanks for testing, but this will take some tricky work which is not done yet.

hrydgard avatar Jan 22 '21 17:01 hrydgard

Is this pr https://github.com/hrydgard/ppsspp/pull/14833 could possibly help this issue?

ghost avatar Sep 20 '21 00:09 ghost

Very doubtful. This is probably uploading depth as noted above, which isn't implemented yet in any backend.

-[Unknown]

unknownbrackets avatar Sep 20 '21 00:09 unknownbrackets

Is this pr #14833 could possibly help this issue?

I tested it and it doesn't fix the problem. Don't need to enable any options, right?

dante3732 avatar Sep 20 '21 12:09 dante3732

Just like unknownbrackets says, it's an unrelated problem, which will need some major work on graphics emulation to fix. It's not possible to get it to work right now.

hrydgard avatar Sep 20 '21 13:09 hrydgard

Still not fixed.

dante3732 avatar Jun 19 '22 11:06 dante3732

Fix coming up, needs testing: https://github.com/hrydgard/ppsspp/pull/15772

hrydgard avatar Aug 01 '22 10:08 hrydgard

Everything breaks randomly, I haven't discovered the dependency yet. NPJH50333_00026

dante3732 avatar Aug 02 '22 09:08 dante3732

I make savestate. After cutscene go up to bicycle, it happened on Vulkan, D3D9, D3D11, OpenGl. Perhaps this bug occurs exactly after the cutscenes. https://drive.google.com/file/d/15mIcJfkLprfMSZBSL1Zub378Ena9tKRK/view?usp=sharing

dante3732 avatar Aug 02 '22 10:08 dante3732

Ok, I'll take a look. Thanks so much for your helpful testing!

hrydgard avatar Aug 02 '22 11:08 hrydgard

This did not happen after every video. This time, there was a video first, then a 3d battle, then videos, and then a transition to a city with a 2d background.

If you go to the pause menu and back, the masks will flash if you stand behind them.

If you do a quick save when an error occurs and then upload, then Depth/Z will work fine.

dante3732 avatar Aug 02 '22 11:08 dante3732

Seems to be reading data from a directory in SAVEDATA that doesn't exist for me:

80010002=sceIoOpen(ms0:/PSP/SAVEDATA/NPJH50333DAT/DATA08.DNS, 1073758209, 8612): file not found

Could you zip up your NPJH50333DAT directory?

hrydgard avatar Aug 02 '22 13:08 hrydgard

Seems to be reading data from a directory in SAVEDATA that doesn't exist for me:

80010002=sceIoOpen(ms0:/PSP/SAVEDATA/NPJH50333DAT/DATA08.DNS, 1073758209, 8612): file not found

Could you zip up your NPJH50333DAT directory?

https://drive.google.com/file/d/1I7XDGbbWD5v-ZLGw0GQNgX_-pBsWJT2l/view?usp=sharing

dante3732 avatar Aug 02 '22 13:08 dante3732

Such a bug happens randomly after FMV videos, not after each one. I already play 15 hours.

dante3732 avatar Aug 06 '22 14:08 dante3732

I changed how the fix works recently, are there still issues after FMV videos?

hrydgard avatar Aug 22 '22 13:08 hrydgard

I changed how the fix works recently, are there still issues after FMV videos?

It flickering. https://drive.google.com/file/d/1pgvRL1IsrQ24dM3Zk8Jomkdi-raX6VVL/view?usp=sharing

dante3732 avatar Aug 22 '22 16:08 dante3732

OK, thanks for testing. Can't close this yet then

hrydgard avatar Aug 22 '22 16:08 hrydgard

Here's the ge dump NPJH50333.ppdmp.zip

ghost avatar Aug 25 '22 14:08 ghost

I changed how the fix works recently, are there still issues after FMV videos?

It flickering. https://drive.google.com/file/d/1pgvRL1IsrQ24dM3Zk8Jomkdi-raX6VVL/view?usp=sharing

I think the flickering is a fmpeg issue and should be separated to this?

ghost avatar Aug 25 '22 14:08 ghost

Well the flickering shown in dante's video doesn't look like an ffmpeg issue.

hrydgard avatar Aug 25 '22 14:08 hrydgard

I think this is the flickering issue talk about here Screenrecorder-2022-08-25-22-33-53-652.zip

save state PPSSPP_STATE.zip

ge dump NPJH50333.zip

lim2222 avatar Aug 25 '22 14:08 lim2222

Its not really flickering on my phone but have a graphics glitch after finishing the cutscene

https://user-images.githubusercontent.com/37603562/186698109-8bc816a4-9b8e-44ba-ba72-d29140ab3be9.mp4

ghost avatar Aug 25 '22 14:08 ghost