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

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

Closed
SausageDog opened this issue Apr 9, 2017 · 41 comments · Fixed by #15772
Labels
Depth / Z Issue involves depth drawing parameters.
Milestone

Comments

@SausageDog
Copy link

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

@unknownbrackets
Copy link
Collaborator

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]

@SausageDog
Copy link
Author

SausageDog commented Dec 27, 2017

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

@unknownbrackets
Copy link
Collaborator

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]

@hrydgard
Copy link
Owner

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.

@unknownbrackets
Copy link
Collaborator

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

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Dec 27, 2017

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...

@JimsAlliance
Copy link

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

@hrydgard hrydgard added this to the v1.11.0 milestone Jun 5, 2020
@hrydgard hrydgard added the Depth / Z Issue involves depth drawing parameters. label Jun 5, 2020
@hrydgard hrydgard changed the title Kurohyo Ryu Ga Gotoku Shinshou - No clipping of 3d characters behind backgrounds based on depth within screen. Kurohyo Ryu Ga Gotoku Shinshou (Yakuza) - No clipping of 3d characters behind backgrounds based on depth within screen. Aug 6, 2020
@hrydgard hrydgard modified the milestones: v1.11.0, v1.12.0 Dec 13, 2020
@dante3732
Copy link

Still not fixed.

@hrydgard
Copy link
Owner

hrydgard commented Jan 22, 2021

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

@ghost
Copy link

ghost commented Sep 20, 2021

Is this pr #14833 could possibly help this issue?

@unknownbrackets
Copy link
Collaborator

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

-[Unknown]

@dante3732
Copy link

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?

@hrydgard
Copy link
Owner

hrydgard commented Sep 20, 2021

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.

@dante3732
Copy link

Still not fixed.

@hrydgard hrydgard changed the title Kurohyo Ryu Ga Gotoku Shinshou (Yakuza) - No clipping of 3d characters behind backgrounds based on depth within screen. Kurohyou Ryu Ga Gotoku Shinshou (Yakuza) - No clipping of 3d characters behind backgrounds based on depth within screen. Jul 19, 2022
@hrydgard
Copy link
Owner

hrydgard commented Aug 1, 2022

Fix coming up, needs testing: #15772

@hrydgard hrydgard removed this from the Future-Prio milestone Aug 1, 2022
@hrydgard
Copy link
Owner

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

@dante3732
Copy link

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

@hrydgard
Copy link
Owner

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

@ghost
Copy link

ghost commented Aug 25, 2022

Here's the ge dump
NPJH50333.ppdmp.zip

@ghost
Copy link

ghost commented Aug 25, 2022

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?

@hrydgard
Copy link
Owner

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

@lim2222
Copy link

lim2222 commented Aug 25, 2022

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

@ghost
Copy link

ghost commented Aug 25, 2022

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

Screenrecorder-2022-08-25-22-51-24-888.mp4

@hrydgard
Copy link
Owner

@Gamemulatorer is the glitch still happening?

@ghost
Copy link

ghost commented Sep 16, 2022

@Gamemulatorer is the glitch still happening?

Not anymore using the latest build.

Record_2022-09-16-17-40-39.mp4

@hrydgard
Copy link
Owner

Hm, in your video, still looks like a little flicker left of the square button?

@ghost
Copy link

ghost commented Sep 16, 2022

It's from my screen recorder

@dante3732
Copy link

dante3732 commented Sep 16, 2022

@Gamemulatorer is the glitch still happening?

It is still flickering, there is a person on the right, in front of whom there is an object and flickering is visible there.
You need to stand behind a bicycle, for example, and the flicker will be good visible.

@dante3732
Copy link

dante3732 commented Sep 16, 2022

@Gamemulatorer is the glitch still happening?

Not anymore using the latest build.

Then what happened in this place on you video?
32323

And here.
32323

@ghost
Copy link

ghost commented Sep 16, 2022

I'm only focusing on this glitch.
Screenshot_2022-09-16-19-35-39-74

@hrydgard
Copy link
Owner

Ah, okay. Good that that one is gone, then.

The little flickers... Dunno. Strange :/

Anyway, gonna consider this good enough for 1.4, moving further work to the next version. Maybe the tiny glitch will be fixed by something else.

@hrydgard hrydgard modified the milestones: v1.14.0, Future-Prio Sep 16, 2022
@hrydgard
Copy link
Owner

hrydgard commented Oct 4, 2022

This broke again in #16150 .

GE dump:
Kurohyou depth problem NPJH50333_0001.zip

Probably due to the trick it does where it reads a 565 buffer as depth, and we use some bits in the address to detect that, and those are normalized-away somewhere. I'll look into it.

@hrydgard hrydgard modified the milestones: Future-Prio, v1.14.0 Oct 4, 2022
@hrydgard
Copy link
Owner

hrydgard commented Oct 4, 2022

Fixed, my bad.

hrydgard added a commit that referenced this issue Oct 4, 2022
@hrydgard hrydgard modified the milestones: v1.14.0, Future-Prio Oct 4, 2022
@hrydgard
Copy link
Owner

I think we can probably close this now, and deal with any remaining bugs or artifacts separately, such as in #15956 .

@hrydgard hrydgard modified the milestones: Future-Prio, v1.14.0 Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Depth / Z Issue involves depth drawing parameters.
Projects
None yet
6 participants