flycast icon indicating copy to clipboard operation
flycast copied to clipboard

Phantasy Star Online Ver. 2 graphic issue

Open mfigueirido opened this issue 1 year ago • 10 comments

Platform / OS / Hardware: Windows 11 x64

Flycast version: v2.3.2-221-g4d73cc8e1

Hardware: AMD Ryzen 2600, Radeon RX 570, 16GB RAM

Description of the Issue

Part of the ground shows visual corruption when looked at certain angles.

I'm not expecting this to be fixed as it looks like an edge case related to Z-fighting, specific to my drivers or hardware, but thought it would be good to have it documented.

Save state: Phantasy Star Online Ver. 2 (USA) (En,Ja,Fr,De,Es).state.zip

Debugging Steps Tested

  • Happens in standalone and Retroarch.
  • Happens in both Vulkan and DirectX11, although it's harder to catch in the latter.
  • Native depth interpolation on/off has no effect.
  • Changing OIT sorting setting has no effect.
  • Saw videos of real hardware and did not notice the issue.

Screenshots

Phantasy Star Online Ver  2 (USA) (En,Ja,Fr,De,Es)-241010-225203

mfigueirido avatar Oct 11 '24 09:10 mfigueirido

It is indeed z-fighting and I can reproduce similar issues in this scene with a Nvidia GTX 1080. Unfortunately there's no easy fix. Related to #1141.

flyinghead avatar Oct 12 '24 08:10 flyinghead

I see. Thanks for checking it out!

mfigueirido avatar Oct 12 '24 10:10 mfigueirido

Just curious: Does this happen with OpenGL at all too?

Wunkolo avatar Oct 12 '24 11:10 Wunkolo

Yes, same glitch with OpenGL and Vulkan for me.

flyinghead avatar Oct 12 '24 12:10 flyinghead

Yes, this is OpenGL: imaxe

mfigueirido avatar Oct 12 '24 12:10 mfigueirido

Some more Vulkan data-points

Result on my Intel UHD Graphics 750: image

Result on my RTX 3090: image

All the GPUs mentioned in this thread support D32_SFLOAT_S8_UINT for DEPTH_STENCIL_ATTACHMENT just fine too.

Might have to do with the driver compiling shaders with varying levels of precision for different shaders similar to these issues: https://github.com/grimdoomer/NvidiaPrecisionLossPoc https://icode4.coffee/?p=566

Wunkolo avatar Oct 12 '24 13:10 Wunkolo

Interesting read... so maybe there's a chance for a fix?

From the second link: "If I could force the optimizer to choose one of the two paths consistently then that should mitigate the issue. Now the solution became clear, instead of calculating the dot product the long way I would use the dp3 intrinsic and a single add. This should optimize the dph function to the point where the shader optimizer wouldn’t be able to perform any further optimizations on it."

mfigueirido avatar Oct 12 '24 14:10 mfigueirido

Not the exact same glitch but I do have intermittent z-fighting on this tex. image

flyinghead avatar Oct 12 '24 14:10 flyinghead

Same behaviour: imaxe

mfigueirido avatar Oct 12 '24 14:10 mfigueirido

I experience this same problem, but in Skies of Arcadia. Nvidia 1070

user18081972 avatar Dec 08 '24 17:12 user18081972