GS/HW: Floor depth writes to improve Z testing#13795
Conversation
4bba595 to
a95b1ed
Compare
|
It fixes z-fighting in the following games:
|
|
Can you also test these 5 Multi Frame GS-Dumps that i tried to upload here? This file is online for 7 days. |
|
Improves distant terrain in Transformers: Master: pcsx2-transformers-z-master.mp4PR: pcsx2-transformers-z-pr13795.mp4👍 |
|
@GitHub-Khi I have checked your dumps, the GT4 and GTA SA ones look identical to HW when running in SW, which means the PS2 will have the same kind of fighting/shimmer. I have however gotten footage of GTA Vice City, Midnight Club and Shadow of the Colossus. All footage is Master HW, Master SW, PR HW. Looks like it fixes all of them (match sw/real machine) :) GTAVC.mp4MC3.mp4SotC.mp4 |
|
Many thanks for these very quick tests and the response! I could have tested it myself, but i will leave that to the professionals. Keep up the good work! ^-^ |
|
Fixes both Rayman 2 and Jackie Chan Adventures |
|
Here are 5 more Multi Frame GS-Dumps for you and for another 7 days. Have fun testing them. :D |
|
I'm going to introduce you to xz compression, I swear :D I'll be back in a year with the results lol |
|
@GitHub-Khi same deal as before. Knight Rider seems to be fighty in HW and SW so is likely just like that on real HW too, so I didn't record that one. RuleOfRose.mp4Tek4.mp4PowerPuff.mp4Wipeout.mp4 |
|
Do not worry, i will not be reviewing any more games, as i do not want to go through every single one. I think that hundreds of games that no one tests or overlooks will be automatically fixed. I hope that all further reports will be accompanied by a self-test + results. Why did you create such fantastic PR that affects so many games? Now here you are with all this stress. Congratulations! xD And thanks again for the quick tests! :) |
|
It was really an accident, I only wanted to make MotoGP3 menu not suck. lol |
if it matches software, it's hardware accurate, and that's all I wanted :) So yes some games will still have z fighting, but what was expected to be there. |
|
I've taken it of draft/test only, it's gone extremely better than expected :) |
PCSX2 2.8 is gonna be insane. Users are gonna lose their marbles when they see how much is about to come lmao |
PCSX2 2.8 is shaping up into a great release 😄 |
|
Fixed Tony Hawk's Pro Skater 3, now matching SW. Vulkan vs SW before this PR: THPS3.Jumpy.Textures.mp4 |
|
That's probably from the :D |
a95b1ed to
c7207db
Compare
|
PR so good that it went from draft to merged in two days. Amazing work :D |
------------------------------------------------------------------------------------------ rocknix-abl.mk 64fb3fca6af9bc097f024464747dd51aaca201b5 # Version: Commits on Jan 11, 2026 ------------------------------------------------------------------------------------------ Update ABL, fix system stats calculations, ------------------------------------------------------------------------------------- azahar.mk 7d2735b118470a9e6e381a363d7cd009a34cadac # Version: Commits on Jan 10, 2026 ------------------------------------------------------------------------------------- Updated translations via Transifex, ----------------------------------------------------------------------------------- eden.mk 1cb8bcf531f6ad1b0afcc3b2179a136535760984 # Version: Commits on Jan 11, 2026 ----------------------------------------------------------------------------------- [dynarmic] disable extra verbose debugging on release builds (#3293) ------------------------------------------------------------------------------------- hatari.mk 8484905c9f29bf0f21e9d69533576ff46e9a7c09 # Version: Commits on Jan 11, 2026 ------------------------------------------------------------------------------------- Move the swapping of the frame buffer pointers from screen.c to conv_st.c This code should belong to the conv code, not to the SDL-related screen code., --------------------------------------------------- pcsx2.mk v2.7.19 # Version: Commits on Jan 11, 2026 --------------------------------------------------- - [GS/HW: Floor depth writes to improve Z testing](PCSX2/pcsx2#13795) , ------------------------------------------------------------------------------------ rpcs3.mk cd6dfc82a27844860d3596f5e031214ef354d849 # Version: Commits on Jan 10, 2026 ------------------------------------------------------------------------------------ cellVdec: also use ctx->framerate to calculate the timestamps ffmpeg 7 doesn't seem to guess the time_base parameter anymore, ------------------------------------------------------------------------------------- snes9x.mk 4b51d103b909e0c1ac566b6865b9f6229a7b59e4 # Version: Commits on Jan 10, 2026 ------------------------------------------------------------------------------------- GTK: configuration option for on-screen messages (#1009) * GTK: config file option for on-screen messages For the GTK port, a configuration file entry to set the timeout length for the on-screen messages (such as when a state file is loaded) has been added., ------------------------------------------------------------------------------------- vita3k.mk 74276ce7ae21838deba378fd9d424b8d526aa6fe # Version: Commits on Jan 11, 2026 ------------------------------------------------------------------------------------- ci: Add macOS ARM64 build - Optimize Linux build & update. - Rename artifacts for store repo., ------------------------------------------------------------------------------------------- xenia-canary.mk 81656a97299c6fd01ea44e45e11af309c9f99b95 # Version: Commits on Jan 08, 2026 ------------------------------------------------------------------------------------------- [XAM] Fixed issue with error code being returned for local session, ------------------------------------------------------------------------------------------- xenia-native.mk 81656a97299c6fd01ea44e45e11af309c9f99b95 # Version: Commits on Jan 08, 2026 ------------------------------------------------------------------------------------------- [XAM] Fixed issue with error code being returned for local session, ----------------------------------------------------------------------------------- ymir.mk 12ca5ef56d731f67bd5bdacd9f3e63ad14e76d27 # Version: Commits on Jan 10, 2026 ----------------------------------------------------------------------------------- build: Try vcpkg tag 2025.10.17 to fix windows-a64 CI build, ------------------------------------------------------------------------------------- ikemen.mk 92fa10f449d1105cc06fd1fecb60a90e31445662 # Version: Commits on Jan 10, 2026 ------------------------------------------------------------------------------------- style: fix code style issues with gofmt, ------------------------------------------------------------------------------------------- moonlight-qt.mk 2549efc8b3623f1e2c6b43abad301a1adf4df898 # Version: Commits on Jan 11, 2026 ------------------------------------------------------------------------------------------- Fix pthread_attr leak, --------------------------------------------------------------- ruffle.mk nightly-2026-01-11 # Version: Commits on Jan 11, 2026 --------------------------------------------------------------- ## What's Changed * tests: Add test for breaking words by @kjarosh in ruffle-rs/ruffle#22701 * desktop: Add GUI for opening a directory by @kjarosh in ruffle-rs/ruffle#22621 * chore: Update translations from Crowdin by @kjarosh in ruffle-rs/ruffle#22733 **Full Changelog**: ruffle-rs/ruffle@nightly-2026-01-09...nightly-2026-01-11, -------------------------------------------------------------------------------------- scummvm.mk 29574ed22fc181d60ceff1de3d9f37213986f6e5 # Version: Commits on Jan 10, 2026 -------------------------------------------------------------------------------------- M4: RIDDLE: Fix Ripley giving marks to wolf forever the second time he pays for an information, --------------------------------------------------------------------------------------- thextech.mk 078a20f5f4dc7e11b4d6504145a9fb673a3d62f8 # Version: Commits on Jan 10, 2026 --------------------------------------------------------------------------------------- Wii: dereference profile on deletion (#1082), ------------------------------------------------------------------------------------ box64.mk 3717266c3a26e97b96febfb7043c84a6271fb87f # Version: Commits on Jan 10, 2026 ------------------------------------------------------------------------------------ [LA64_DYNAREC] Removed LASX from hard dependencies (#3350), ----------------------------------------------------------------------------------------- catacombgl.mk c21a1c6ae7973eae24266c8414857bef0ec872e4 # Version: Commits on Jan 11, 2026 ----------------------------------------------------------------------------------------- Introduce Uint16Utility and Uint32Utility, ------------------------------------------------------------------------------------ cdogs.mk cb176456c33a1387b04140309cd4ec9ad57c36ae # Version: Commits on Jan 11, 2026 ------------------------------------------------------------------------------------ basic kanga run #712, ---------------------------------------------------------------------------------------- supertux2.mk fdf00aa91f3ddcc7fa840158a8fc85b5b1aa831c # Version: Commits on Jan 06, 2026 ---------------------------------------------------------------------------------------- Fix crash when activating 'Show collision rects' in debug menu When activating 'Show collision rects' from the debug menu while Editor is not active, the game crashed with a nullptr access. This is fixed by separating the check for Editor active and the show collision rects flag from the debug menu., ---------------------------------------------------------------------------------------------------- sdl2-gamecontrollerdb.mk c42c9093fb9976b6acade29e396de33e757ac39b # Version: Commits on Jan 10, 2026 ---------------------------------------------------------------------------------------------------- Add ShanWan Q36 thanks @LastLifeLeft, ---------------------------------------------------------------------------------------- retroarch.mk 63931092dd306b9b4e8c66fa55464bb287456cbb # Version: Commits on Jan 10, 2026 ---------------------------------------------------------------------------------------- apple: small cleanups to the metal video driver. don't use it. fixes #8655 #8983 #15747 #17860 #18442 #18408, ---------------------------------------------------------------------------------------- doomretro.mk c2edac1cfd0a1c6c9810589bfbe080a82ac4d5c8 # Version: Commits on Jan 11, 2026 ---------------------------------------------------------------------------------------- More minor tweaks, -------------------------------------------------------------------------------------- vkquake.mk bd15df1ecd4e6442702ef1097f4dbb70a5e83cf3 # Version: Commits on Jan 10, 2026 -------------------------------------------------------------------------------------- Removed con_warnings of not-loop LIST WAV chunks, ----------------------------------------------------------------------------------------- sonic3-air.mk e072af26128cbcecc1ca1733ddc4de271e79f248 # Version: Commits on Jan 11, 2026 ----------------------------------------------------------------------------------------- Fix web build, ---------------------------------------------------------------------------------- trx.mk e85cdfe58a710b59ad53af8b7aaad05bbf0fbc4f # Version: Commits on Jan 10, 2026 ---------------------------------------------------------------------------------- camera/los_camera: combine Lara state checks This combines the state checks for Lara for both look and regular movement., ---------------------------------------------------------------------------------------------- libretro-fake08.mk a9bb61f483ac8aac921a97b96254144abc995774 # Version: Commits on Jan 10, 2026 ---------------------------------------------------------------------------------------------- Update z8lua with support for ~ as bxor operator, -------------------------------------------------------------------------------------------------------------- libretro-genesisplusgx-expanded.mk 83c2daff0f26620fec51a29820b85f8409bd5840 # Version: Commits on Jan 11, 2026 -------------------------------------------------------------------------------------------------------------- Additional System that adds 2.5GB SWAP, ------------------------------------------------------------------------------------------------ libretro-nestopia.mk 473d3072be67fa2542ca833c274ef6682cf0f0bc # Version: Commits on Jan 10, 2026 ------------------------------------------------------------------------------------------------ libretro: Fix up VS. System palette, ----------------------------------------------------------------------------------------------- libretro-scummvm.mk 29574ed22fc181d60ceff1de3d9f37213986f6e5 # Version: Commits on Jan 10, 2026 ----------------------------------------------------------------------------------------------- M4: RIDDLE: Fix Ripley giving marks to wolf forever the second time he pays for an information, --------------------------------------------------------------------------------------------- libretro-vba-m.mk 4ca32c23fff58ddaa33b7b81f31eb811f217d6ca # Version: Commits on Jan 10, 2026 --------------------------------------------------------------------------------------------- translations: transifex pull Signed-off-by: Rafael Kitover <rkitover@gmail.com>,
|
Unfortunately, it did not fix Ape Escape/Saru! Get You!: Million Monkeys, although I'm not sure if this PR would even tackle the more agressive vertex explosions going on with that game... |
|
is there a point you can find in footage of a real PS2 you can compare to PCSX2 that still looks wrong? There's a very non-zero chance that the z fighting is there on the console also, and the goal was towards console accuracy, not improving upon (probably impossible with hardware lol) |
|
BT2 and BT3 isn't fully solved but the most apparent Z fighting is gone. I'll test it later on real PS2. |
Thanks, I would love to see pictures, because I suspect it will still be there :) |


















This is only a test for now, further changes may be required or may become optional.
Description of Changes
Floors the depth write values to improve Z fighting, closer/accurate to software in a lot of cases.
Rationale behind Changes
On the PS2 you only have integer depth available, where in hardware, when we interpolate, we get a sliding scale of decimal values, which can lead to depth tests failing when they shouldn't. This improves this a lot.
Suggested Testing Steps
Test a whole host of games, make sure the Z fighting is better/closer to SW, where it's not caused by limited depth range. Could be worth checking games in #3692
Did you use AI to help find, test, or implement this issue or feature?
No
Fixes a lot of the problems on #11048 for MotoGP games, along with the changes in #13794
Fixes #12670 Haunting Ground
Fixes #6101 Rayman 3 (as good as software)
Improves #3692
Most notable changes:
Avatar Last Airbender (eyes were bad):

Master:
PR:

God Hand:

Master:
PR:

Harry Potter:

Master:
PR:

Haunting Ground (look in the door at the back):

Master:
PR:

Midnight Club 3:

Master:
PR:

MotoGP 3:

Master:
PR:

Need For Speed Undercover:

Master:
PR:

Need for Speed Underground 2:

Master:
PR:

Okami:

Master:
PR:

Rayman 3:

Master:
PR:

Sonic Heroes:

Master:
PR:

Tony Hawk Pro Skater 3:

Master:
PR:
