ppsspp icon indicating copy to clipboard operation
ppsspp copied to clipboard

Elements missing when scoping in Valkyria Chronicles II (ULUS-10515)

Open justafella opened this issue 5 years ago • 39 comments

What happens?

Things such as objects from scenery disappear while scoping. Sometimes soldiers get cropped as well if they're in front of those objects. Happens on Vulkan and Direct3D 11.

What should happen?

Everything should be fine as is with Direct3D 9 and OpenGL.

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

  • Windows 10 64 bit;
  • Acer Aspire ES15;
  • Intel Celeron QuadCore N3450;
  • Intel HD Graphics 500 (driver ver. 27.20.100.8587);
  • 4 GB RAM;
  • ppsspp v1.10.3-735-ga0251eae2

ULUS10515_00000 ULUS10515_00001 ULUS10515_00002

Here is a Save State for testing: ULUS10515_1.00_2.zip

justafella avatar Sep 21 '20 15:09 justafella

As for cropped units: ULUS10515_00000 ULUS10515_00001 ULUS10515_00002

justafella avatar Sep 21 '20 15:09 justafella

@justafella could you send me the GE Dump for scoping?

Panderner avatar Sep 21 '20 15:09 Panderner

How do I do it?

justafella avatar Sep 21 '20 15:09 justafella

How do I do it?

Just go to http://ppsspp-debugger.unknownbrackets.org/

Panderner avatar Sep 21 '20 15:09 Panderner

Well, if I got that right, these are the files:

Scoping: recording (2).zip

Scoping+zoom: recording (3).zip

If you need it, whenever I come across the cropped unit problem again I'll bring its GE dump as well

justafella avatar Sep 21 '20 16:09 justafella

Thanks, those will be useful!

hrydgard avatar Sep 21 '20 17:09 hrydgard

If you need it, whenever I come across the cropped unit problem again I'll bring its GE dump as well

Here it is:

Cropped unit on scope: recording.zip

Cropped unit on scope+zoom: recording (1).zip

Hope it helps you guys

justafella avatar Sep 23 '20 22:09 justafella

Well, here's something interesting.

In Valkyria Chronicles 3, I reproduced easily. In the GE debugger, I then disabled the depth clamp flag for a frame, which fixed it, because background stuff was clamping over the character.

But then I realized that it stayed fixed - nothing was turning clamp back on. I played through a bunch of the game without it getting set back enabled. Instead, returning to the chapter map finally re-enabled it. It also re-enabled when going to the deploy screen, each time when "Now loading" was being shown. Interestingly, for the loading into the mission - it did not set the depth clamp flag.

So it could be this is depth clamp behaving wrong - but it could also be that, somewhere, something is supposed to clear this and isn't? Well, just a guess. I can't find anything obvious that should be resetting it (like contexts on lists or signals or CALLs etc.)

-[Unknown]

unknownbrackets avatar Feb 16 '21 03:02 unknownbrackets

The behavior described in #12058 should fix this.

-[Unknown]

unknownbrackets avatar Sep 07 '21 05:09 unknownbrackets

I have tested the game with the same save state I provided back then, using the latest buildbot. My system remains the same apart from the graphics driver's version (that I keep updated). I tested it on all backends (with hardware transform on and then off) but only D3D9 worked properly. I couldn´t understand everything here, so if there is something more I could do for testing as an end-user, I´ll gladly help.

justafella avatar Sep 12 '21 15:09 justafella

If you try the artifacts in #14833, it should fix it on modern systems.

-[Unknown]

unknownbrackets avatar Sep 12 '21 16:09 unknownbrackets

I haven't been able to test this yet because I can't seem to build it right. I'm all new to this and even with the instructions provided I'm still messing up somewhere. I'd be grateful if you could build it and send me a .zip or something.

justafella avatar Sep 18 '21 14:09 justafella

There's a build attached to the under artifacts.

  1. Go to https://github.com/hrydgard/ppsspp/pull/14833/checks.
  2. Select Artifacts near the top right.
  3. Select Windows x64 build (or similar.)

macOS, Windows ARM64, and Linux builds are available too. These are not permanent however, and only last for 90 days after the code in the pull request is most recently updated.

-[Unknown]

unknownbrackets avatar Sep 18 '21 22:09 unknownbrackets

IT IS FIXED!!!! Thank you!!!!! You may close the issue 🥇

justafella avatar Sep 18 '21 22:09 justafella

Thanks for reporting!

Let's close it when that branch is merged - I'm not gonna merge it for 1.12, due to the risk of breakage. It will however be merged soon after that release, and then we can close this.

hrydgard avatar Sep 19 '21 10:09 hrydgard

Does not seem to fix the issue for me on macOS 11.6 with https://github.com/hrydgard/ppsspp/pull/14833 on Vulkan. OpenGL implementation is unsupported as explained in https://github.com/hrydgard/ppsspp/pull/14833#issuecomment-922460423.

Screenshot 2021-09-19 at 15 32 38

Confirmed that the latest master of https://github.com/KhronosGroup/MoltenVK (https://github.com/KhronosGroup/MoltenVK/commit/f78ab20b79f186eae57606442293163c748de5d3) does not solve the issue at the very least.

vit9696 avatar Sep 19 '21 12:09 vit9696

Vulkan on MacOS uses MoltenVK, it could be that it lacks support for the clip/cull distances.

hrydgard avatar Sep 19 '21 13:09 hrydgard

That somewhat surprised be, but you are right:

(lldb) p caps_.clipCullDistanceSupported
(bool) $0 = false
(lldb) p vulkan->GetDeviceFeatures().enabled.shaderClipDistance
(const VkBool32) $1 = 1
(lldb) p vulkan->GetDeviceFeatures().enabled.shaderCullDistance
(const VkBool32) $2 = 0

There is a note on that in https://github.com/KhronosGroup/MoltenVK/issues/203#issuecomment-419676902. Interestingly, culling appears to be rather rarely used by the games (https://github.com/KhronosGroup/MoltenVK/issues/203#issuecomment-494815290), so one can expect it not to land any soon. I wonder if the alternative can be found here.

vit9696 avatar Sep 19 '21 13:09 vit9696

To be fair, software one (i.e. HardwareTransform = False) does work fairly well for me with both OpenGL and Vulkan though after fixing up the hardware usage requirements in https://github.com/hrydgard/ppsspp/pull/14833#discussion_r711746731 without performance issues. However, this is a desktop (11700k clocked at 5.0 GHz to be precise), laptops may have bigger issues.

vit9696 avatar Sep 19 '21 13:09 vit9696

Is there any way I can get an android build with these fixes? I have a Moto G9 Play with Qualcomm SM6115 Snapdragon 662 (11 nm) Octa-core (4x2.0 GHz Kryo 260 Gold + 4x1.8 GHz Kryo 260 Silver) Adreno 610

justafella avatar Sep 25 '21 18:09 justafella

Is there any way I can get an android build with these fixes? I have a Moto G9 Play with Qualcomm SM6115 Snapdragon 662 (11 nm) Octa-core (4x2.0 GHz Kryo 260 Gold + 4x1.8 GHz Kryo 260 Silver) Adreno 610

You need to compile this https://github.com/hrydgard/ppsspp/pull/14833 all by your self.

ghost avatar Sep 26 '21 03:09 ghost

It'll get merged in not very long and included in git builds. It should work on Adreno, but it won't yet work on Mali, so it's not a complete fix. Be warned there are likely to be issues on some devices once it's merged, so I can't say for sure it'll work on your device.

-[Unknown]

unknownbrackets avatar Sep 26 '21 03:09 unknownbrackets

thanks(^o^). working on v1.12.3-39-g16bf5197e vulkan adreno 530 Valkyria Chronicles 3 Screenshot_20211019-213637

IrfanH495 avatar Oct 19 '21 14:10 IrfanH495

I try the dump and here's the results. Screenshot_2021-10-19-23-19-41-123_org ppsspp ppsspp Screenshot_2021-10-19-23-19-27-727_org ppsspp ppsspp

ghost avatar Oct 19 '21 15:10 ghost

@Gamemulatorer not sure I understand, is that a failure or success? Which GPU on your device?

hrydgard avatar Oct 19 '21 15:10 hrydgard

@Gamemulatorer not sure I understand, is that a failure or success? Which GPU on your device?

I think is a success because as far as I can see all elements is present 🤔🙂

ghost avatar Oct 19 '21 16:10 ghost

Ok, so several successful reports. I'm gonna close this, even though the new code doesn't have full effect on Mali and D3D9 yet.

hrydgard avatar Oct 19 '21 17:10 hrydgard

@hrydgard while D3D9 is rather old, macOS VK/GL is considerably new. Shall we have a separate issue for the added code being incompatible with macOS? I believe a shader implementation will still be faster than a software one.

vit9696 avatar Oct 19 '21 18:10 vit9696

@vit9696 who says the added code is incompatible with macOS?

hrydgard avatar Oct 19 '21 18:10 hrydgard

Apple GL doesn't expose cull distance, possibly also with Vulkan. But I thought this one was probably fixed by clipping, so it might be fixed anyway? If it requires cull, then I think it's still related to all the other open guardband issues.

-[Unknown]

unknownbrackets avatar Oct 19 '21 18:10 unknownbrackets