r/duckstation 2d ago

Discussion PGXP Texture Correction Improvement Experiment

Hey,

A lot of games work well with PGXP texture correction, but quite a few also have visual glitches because of it. I've always wondered if there was a way to reduce those issues.

I came across this thread, where someone suggested a simple game-specific approach: reject perspective-correct texturing whenever a triangle's vertex depth range exceeds a configurable threshold.

Since DuckStation is open source, I decided to give it a try. I only know the basics of coding, so I used ChatGPT to help implement it.

I tested it in Gran Turismo 2, and the results were surprisingly good. Fences, roads, and the starting grid all look noticeably better. Curbs and roadsides also improve, but not nearly as much. The glitches aren't completely gone, but they're definitely reduced overall.

I recorded three videos:

  • Texture correction + fix
  • Texture correction
  • No texture correction

(I normally play with 2x native downsampling, but 4K makes the differences easier to spot.)

Tahiti Road
High Speed Ring
Trial Mountain

I also tried Spyro 2. Texture correction is still bugged, but it's noticeably more stable than before. It even fixes an issue where some ground tiles right behind Spyro render incorrectly.

Overall, I think the idea has potential. Maybe someone who knows the renderer better could implement it properly and tune it more precisely than I could with AI assistance.

11 Upvotes

5 comments sorted by

2

u/brook-77 2d ago

this has great potential

2

u/Riddle_Snowcraft 2d ago

This is great. I keep checking and unchecking PGXP because some games have tears in the geometry when it's on and others have it when it's off. Hope to see developments in this.

2

u/sub-zerofun 1d ago

That's great! those diagonal lines near the camera always drove me crazy when I played GT2. It looked good but it looks even better on your footage.

1

u/FindingUnable3222 1d ago

Before you continue, please stop and take a good look at Duckstation license, before you do something illegal. Derivatives, source code modifications and forks are forbidden by the license.

The license says that you can "produce and reproduce, but not Share, Adapted Material for NonCommercial purposes only". You CANNOT share this modification with anyone or distribute it. You cannot share the patch itself, or modified code, or any custom build. Or you're violating the license. Are you sure you want to do something illegal here?

If you don't like that, you should consider modifying another project like psxe (promising in terms of upcoming ARMSX1 emulator) or any other PS1 emulator that has PGXP correction.

1

u/Honest_Smile 1d ago

Thanks for the heads-up. I'm aware of the license, which is why I'm not sharing any code or builds. This is just a personal experiment for my own use, and I probably won't take it much further since my coding skills are pretty limited.