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

Dissidia 012: Bad camera transitions during cutscenes #11260

Closed
GrieverV opened this issue Jul 20, 2018 · 5 comments · Fixed by #11393
Closed

Dissidia 012: Bad camera transitions during cutscenes #11260

GrieverV opened this issue Jul 20, 2018 · 5 comments · Fixed by #11393
Labels
Guardband / Range Culling Involves vertices outside fustrum.
Milestone

Comments

@GrieverV
Copy link

GrieverV commented Jul 20, 2018

Recording showing the problem:
https://my.mixtape.moe/rpiskq.mp4

What it should look like:
https://www.youtube.com/watch?v=vm04EHjKEao&feature=youtu.be&t=229

Confirmed reproducible at native resolution with default ini. Tested with OpenGL and Vulkan backends; Vulkan appears to trigger the issue in more scenes than OpenGL.

OS: Linux/ArchLinux x86-64
GPU: Radeon RX 480
GPU Driver: Mesa radeonsi/radv 5ba3e5c
PPSSPP: 9be6b22

@GrieverV
Copy link
Author

Here's an example where Vulkan is incorrect but OpenGL displays correctly:

OpenGL:
https://my.mixtape.moe/gwkpph.mp4
Vulkan:
https://my.mixtape.moe/jarqty.mp4
PSP(?):
https://youtu.be/20MaMF8yoKk?list=PL7D9690053C7FC33E&t=146

Scene information:

Main Scenario 012: Treachery of the Gods
Epilogue - An Undocumented Battle
071: The Manikins' Destination

You can access scenes through the title screen -> Collection -> Museum -> Theater

@unknownbrackets
Copy link
Collaborator

Wonder if this is some sort of viewport clamping issue, then.

-[Unknown]

@GrieverV
Copy link
Author

GrieverV commented Jul 21, 2018

Tested the software backend and the first issue which affects both OpenGL and Vulkan displays correctly using software; the second issue also displays correctly.

I switched over to Windows and ran GE Debugger on the frames and also created a few frame dumps. I did have to step through a few frames for the recording to complete, although it was still on the frames experiencing the issue.

Here's a zip archive containing GE Debugger screenshots and frame dumps for both software and vulkan:

dissidia012.zip

edit: The included GE screenshots are likely useless since they were simply taken on the exact frame the issue occurred. I was able to step through prims until the issue occurred but was unsure where to go from there since it affects the whole screen.

Let me know if I can provide any other information or have any ideas what I should be looking for in the debugger.

@unknownbrackets
Copy link
Collaborator

The first framedump -

Yuna is drawn with Texture L0: 0x08ac59f0 (256x256), which actually seems to draw just fine. However, Tifa is then drawn with Texture L0: 0x08af6840 (256x256). I'm pretty sure Tifa is supposed to be behind the camera at this point.

There isn't a single vert with a depth value inside the minz/maxz range of [10000, 50000]. The clip flag is enabled (which causes depth to clamp to [0, 65535]), but that shouldn't matter in this case. Just as importantly, the X and Y values are outside the drawing space for every or almost every vert, so they should be culled (but this one isn't supported yet.)

It could be we're just seeing some triangles which are partially clipped (rather than culled) and happen to intersect the valid depth range after clamping to [0, 65535]. OpenGL does not yet support clamping (but this is incorrect.)

After the draw, all pixels have depth set to 50000 (the maxz value), which seems to confirm this suspicion.

So I think this is related to #9527. It looks like this is true for the one that affects OpenGL too, but the depth range just doesn't trigger the separate bug that OpenGL lacks depth clamping, so it's seen even in OpenGL.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

The software renderer shows these more or less correctly now, so I think that confirms that it's the frustum cull.

-[Unknown]

@unknownbrackets unknownbrackets added the Guardband / Range Culling Involves vertices outside fustrum. label Sep 3, 2018
unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Sep 18, 2018
Vulkan clamps to the clip range, not the full range.  So when clipping, we
don't really want to clamp at all.  Unfortunately, when one side is
clipping, we can't do it exactly right.

But many games clip depth, like Dissidia.  Fixes hrydgard#11260.
@unknownbrackets unknownbrackets added this to the v1.7.0 milestone Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Guardband / Range Culling Involves vertices outside fustrum.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants