Next Generation Emulation banner

PCSXR-PGXP

660K views 1K replies 155 participants last post by  helpmesimba 
#1 · (Edited)
PGXP (Parallel/Precision Geometry Transform Pipeline) is an enhancement for PlayStation emulation that produces high precision fully 3D geometry data that was not available on the original console hardware.

It is currently integrated with PCSX-Reloaded via Pete's OpenGL v1.78 plugin and Tapeq's Tweak extension to Pete's OpenGL v2.9 plugin.

Note: This project is still very much a work in progress.

Features
  • High Precision Vertex Data (more stable geometry)
  • Reduced Triangle Culling (more detailed models)
  • Perspective Correct Texture Mapping (reduced texture distortion)

Chrono Cross: Distortion of model geometry is significantly reduced, especially at a distance.


Ridge Racer Type 4: Higher precision culling calculations mean that small triangles are no longer culled


Tomb Raider: 3D vertex coordinates mean affine texture mapping can be replaced by perspective correct mapping

Setup Instructions
Download the required files (links to these can be found below):
  • A WIP build of PCSXR-PGXP
  • A complete install of PCSX-Reloaded
  • Pete's OpenGL2 PSX GPU Plugin v2.9
Copy the PCSXR-PGXP.exe file from the WIP build to the root folder of the PCSX-Reloaded (the one with the PCSXR.exe file in it). Then copy the gpuPeopsOpenGL.dll and gpuPeteOpenGL2Tweak.dll files to the "Plugins" folder.

If you don't already have it copy the "gpuPeteOpenGL2.dll" file to the Plugins folder too (this is required for the Tweak plugin to work).

Note: If the plugins fail to appear in the "Graphics" menu of the "Plugins & Bios..." window then you may need to install the Visual C++ Redistributable 2015 (x86).

Debug Visualisations
Various shading modes are available by pressing F11 when using the OpenGL 1.78 plugin each of which show different information regarding vertices. There are currently three such modes that can be cycled through, the first shows the different states of each vertex:
  • Blue: Successfully tracked from transformation on the GTE to the GPU.
  • Cyan: Tracked but has lost its 'w' component.
  • Yellow: The vertices belong to a 2D sprite element.
  • Red: No valid value was found so it falls back on the native low precision values.
  • Green: A suitable high precision value has been found in the cache
  • Magenta: Multiple high precision values were found at the same position of the cache, making the result ambiguous, so the low precision value is used.
The other two modes display depth values as a spectrum through blue, green and red. The second mode being the 'w' components of the vertices (in older versions this was grey scale).

The last shows depth information taken from the Ordering Table used by the PlayStation to sort primitives so they can be rendered from furthest to nearest.

Links
Most Recent Builds:
WIP_PGXP_build_19_03_02.zip


Source Code:
PCSXR-PGXP: https://github.com/iCatButler/pcsxr
Tapeq's OpenGL Tweak Plugin with PGXP: https://github.com/iCatButler/PeteOpenGL2Tweak

Additional Links:
Official PCSX-Reloaded Home Page: https://pcsxr.codeplex.com/
Pete's OpenGL2 PSX GPU Plugin: http://www.pbernert.com/html/gpu.htm#OGL2
Visual C++ Redistributable 2015: https://www.microsoft.com/en-us/download/details.aspx?id=48145
Visual C++ Redistributable 2010 (may be needed for other plugins): https://www.microsoft.com/en-gb/download/details.aspx?id=5555
Tapeq's Tweak Plugin Thread: http://ngemu.com/threads/peteopengl2tweak-tweaker-for-peteopengl2-plugin-w-gte-accuracy-hack.160319/

Previous Builds:
WIP_PGXP_build_18_12_16.zip

WIP_PGXP_build_17_04_25.zip
WIP_PGXP_build_17_03_19.zip
WIP_PGXP_build_16_08_01.zip
WIP_PGXP_build_16_08_31.zip
WIP_PGXP_build_17_03_17.zip


Thanks to:
Tapeq
Pete Bernert
Edgbla
Simias
The PCSX-R team
And everyone who has provided feedback.
 
See less See more
5
#3 ·
Very impressive work! It's running great with many of the games I've tested it with, really improves how it looks.
Kinda odd to see a racing game with straight lines :p

Just wanted to note, with Hydro Thunder, the hack does not work at all.
According to F11 debugging, everything shows up as red, even with Recompiler/Interpeter or Memory/Memory+CPU
Enabling Vertex Cache will get things flickering madly as green/red/magenta and generally breaks the graphics massively.

 
#4 ·
This is great! Having an exclusive thread is much better! To commemorate (kinda XD) I made a video showcasing Medal of Honor in the latest WIP:
This game works great using "Memory only" mode on PGXP. Only the sky seems to be low precision, but I guess that's a skybox, maybe just a big 2D texture.

About the internal frames per second, I don't know if it's a bug with Pete's OpenGL2 2.9 plugin (which the TWEAK uses as its base), or if the plugin fixes a timing issue (?) with this game, because parts with no enemies run at 60 FPS, while parts with enemies run at 30 FPS. The corridors with leaf fences at both sides also run at 30 FPS. The OpenGL 1.78 makes the game run at a constant 30 FPS. This is the emulator running without overclock; with it, the parts that run at 60 FPS are more "constant", without common deeps to 55-50 FPS. This also happens on ePSXe's OpenGL 2 "core plugin", so maybe that's the correct behavior? And since people say Mednafen is the most accurate PSX emulator, I tried it with that, and it runs at a constant 60 FPS XD. I don't know what's going on, but at least it's very playable.
 
#8 ·
Here's Crash Bandicoot 3: Warped.
Although there's an issue, where at a distance "holes" will appear on the ground (like what the old GTE accuracy hack did on some games), the character models and the rest of the scenario are high precision, using "Memory only" mode.

This game does not work very well with the widescreen hack, but it's not as bad as Crash 1 and 2. I preferred to record this using the hack anyways, because that big overscan in the NTSC version is just stupid in 4:3, so the game will look kinda of "cinematic" in widescreen XD (XMedia Recode gives me an aspect ratio of 1.9692). I think since the Crash games are 3D "corridor" platformers, there was no need to create more scenario where the player would never get to explore, so the original PSX trilogy might never get a proper widescreen method, even if the widescreen hack is improved someday. Unless someone discovers a way to change the FOV, and also re-position Crash so that he is further on the field, than maybe a vert- method would work... just dreaming though.

I do hope Sony does a good job on remaking these games, because as emulation already shows, remasters might not work very well.
 
#11 ·
@SolisX Hi! Good idea, I've put a few comparisons in the first post to illustrate the differences. I'll probably put together a video at some point as the difference in motion is even more stark. I've included a couple more images that I put together.

This one shows just how distorted some models can get, the vertices effectively snapping to a square grid.

The distortion effect on faces is also pretty striking.
@gamax92 I suspect Hydro Thunder is writing individual bytes, PGXP currently only tracks 16 and 32-bit reads and writes because vertex coordinates are stored as two 16-bit values.

What's happening when the cache is enabled looks like random false positives. There are vertices being transformed and added to the cache but not at their final screen space positions, so when GPU plugin does a lookup it's sometimes finding a value but probably not the right one.

@otherman good point about the VC++ redistributable, I've added it in now. The 64-bit dynarec is only used in the linux and MacOS versions, the Windows solution only includes the x86 version, I updated it to help CarterLi on GitHub build for Mac.
I did get it working for Windows locally, with a lot of hacking about, but there seemed little point to releasing that version as most of plugins available are only compiled for 32-bit.

@TheDimensioner I've noticed those holes in Crash 3, unlike other cases I can't seem to influence those by modifying NCLIP, although the game does seem to use it for back face culling. I can only assume those gaps are either in the original mesh or being created as part of the tessellation/LoD system before the vertices are transformed.
 
#15 · (Edited)
Is it possible to call the "Reduced Triangle Culling" feature in some sense an analogue of the tessellation? After all, judging by the screenshots, the final result is similar to tessellation - the models are more detailed.
The default behaviour of the PlayStation is a sort of reverse tessellation, or implicit mesh simplification. This image illustrates what's happening quite well.
All the triangles are being transformed but the low precision results in many vertices of small triangles getting the same position. This causes those triangles to collapse into lines or points, becoming degenerate, with an area of zero.
You can see this happening in the image where groups of small triangles form simple squares, two or three triangles stretch as their vertices snap to the same few points while other triangles disappear altogether.

The PlayStation's GTE has a function to cull these degenerate triangles called NCLIP which also removes triangles that are facing away from the viewer (back-face culling). As PGXP calculates and stores vertices in high precision the implicit simplification doesn't happen but the default NCLIP behaviour still results in small triangles, that would have become degenerate, being culled. This is because the emulated game expects a low precision integer value which will be truncated to 0 for many small triangles.

To solve this PGXP calculates its own NCLIP result in high precision and then intentionally skews the results so that values that would become 0 are now rounded up to 1 or -1 before passing it back to the emulator. So technically, rather than creating more triangles from a mesh, it is preserving existing triangles that would otherwise be simplified out.
 
#14 · (Edited)
Hah, the "widescreen cheat" for Crash 3 works!
Although there are much more issues than with the hack XD. The area shows more on the sides on some parts, but there are those sudden stretches of the characters and camera hiccups. The UI is also stretched, unlike with the widescreen hack, although it's only for this game.

I "forced" 30 FPS for this recording, that's why the music plays faster sometimes. Isn't there a 60hz code for the PAL version of this game? Like I said in the Tweak's thread some times, PAL versions have less overscan, or none at all, generally showing a little more of the screen. But they're mostly 25/50FPS, which I'm not used to. So a hack or a patch for 60hz would be nice.
 
#17 ·
Showing Resident Evil: Survivor. This time I made 2 videos, one with PGXP and other enhancements (xBRZ and shaders), and another without PGXP and no enhancements (besides high internal resolution). I think this game is great for showing PGXP, because it has many detailed textures in the walls and floors. Without PGXP, the slightest movement of the camera distort everything, and on cutscenes, you can really see how bad the character models "tremble" (the last custcene in the no PGXP video is the worse). "Memory only" mode works very well here, although there are still some parts where the floors will "auto-align" as you walk on them, and also some "stair loading screens" with wobbly steps.

Resident Evil: Survivor, PGXP enabled


PGXP disabled, no enhancements


@iCatButler, if it interests, you could use these two videos on the first post, because I think they show really well what PGXP does. I know it would be best if it were one video showing each footage side-by-side, but I don't know how to do that XD. I'm not suggesting this for views or anything, I just think that PGXP is great, and it has to be known by its greatness (also you as the author :D)! A better game would attract more attention though XD.
 
#19 ·
GTA 2 doesn't work with PGXP XD. I was thinking if this was similar to DOOM, as it's not actually 3D, but using "Mem + CPU logic" mode stretches everything, like it did with most games I played before, so maybe the buildings are 3D.

PGXP "Memory only" mode:
Line Architecture Building
Red Text Orange Line Font
PGXP "Mem + CPU logic" mode:
Font Screenshot
Line
 
#20 ·
GTA 2 doesn't work with PGXP XD. I was thinking if this was similar to DOOM, as it's not actually 3D, but using "Mem + CPU logic" mode stretches everything, like it did with most games I played before, so maybe the buildings are 3D.

PGXP "Memory only" mode: PGXP "Mem + CPU logic" mode:
Does the Perspective Correct Texturing not work with GTA? Those textures are so wobbly lol
 
#24 · (Edited)
@Thirteen1355, @superjupi Legacy of Kain: Soul Reaver works, but needs "vertex caching", because textures won't be "connected" without it. It's different from the initial issues Spyro had, though. Here the triangles are bigger, and it looks like a mosaic art of some sort XD. I've made videos (again XD), one with vertex caching (and enhancements) and another with OpenGL 1.78 and no vertex caching, just the intro, to show the issue. I used "Memory only" mode, because I really saw no difference using "Mem + CPU logic", aside from the slowdown.

Legacy of Kain: Soul Reaver, "Memory only" mode + vertex caching (Pete'sOGL2 Tweaks 2.4)


"Memory only" mode, no vertex caching (OpenGL 1.78)


The slowdowns are due to my weak system, and also because this game has lots of details, and is also heavier for the emulator (probably). The weird thing about it, is that the internal FPS when using Pete'sOGL2 (Tweaks or not) is 30 on some scenes, but it jumps to 60 during battles or rooms with animated objects, like the flying souls the main character eats. It's very perceivable on the first video (I can't record at 60FPS on high resolutions), there's slowdown whenever an enemy appears, or after entering a big room. If I enable CPU overclock, the game "locks" at 30 FPS all the time, but animations are faster, and some cutscenes will break. Using OpenGL 1.78, the FPS is 30 all the time as well, without overclock. Maybe Pete's OpenGL2 2.9 really has some timing issue, because this is the second game that changes FPS like that (Medal of Honor was the first). But I have no way to measure the FPS on the real hardware, so I wouldn't know what's the correct behaviour of those games.
 
#26 · (Edited)
So, I got kind of nostalgic and decided to dust off my old PlayStation, see if still worked. It did, so I decided to play some Crash Bandicoot, in its original form, the way it was meant to be played. The disc I have has Crash 1, 2 and 3 in it, but 1 didn't worked, so I pressed reset, and now booted Crash 3. Besides my head now not being able to clear the feeling of "why everything shakes?" (I got too used with PGXP XD), I immediately noticed something. Those "holes" that appear at a distance, even with PGXP, happen on the real hardware as well! It's very weird actually, I don't remember that happening at all. Unless my PlayStation is too old (it only works when standing vertically actually), or maybe the disc I have has been compressed or had something modified to fit the 3 Crash games in it, but still, maybe this issue can't actually be fixed with PGXP. Some kind of ancient draw distance/LoD bias method? Here's some pics and video (got used to it now). I had to use a Windows Phone to record, and also sorry about my old 14" CRT, it sucks, but I still play my Wii on it XD.

Crash Bandicoot 3: Warped on real PlayStation. Original SCPH-1001 model, with the separate RCA inputs and parallel I/O port, if it interests. It also has that issue with the power supply being just under the CD drive, so over time it heated up the lens, its thin metal support dilated and shifted the lens focus, that's why it only works standing up.
Also some pics
Screen Technology Electronic device Gadget Television
Technology Electronic device Screen Display device Electronics
Screen Electronics Technology Electronic device Display device
Screen Technology Games Electronic device Display device
EDIT: The pics were too big :oops:.
 
#29 ·
So, I got kind of nostalgic and decided to dust off my old PlayStation, see if still worked. It did, so I decided to play some Crash Bandicoot, in its original form, the way it was meant to be played. The disc I have has Crash 1, 2 and 3 in it, but 1 didn't worked, so I pressed reset, and now booted Crash 3. Besides my head now not being able to clear the feeling of "why everything shakes?" (I got too used with PGXP XD), I immediately noticed something. Those "holes" that appear at a distance, even with PGXP, happen on the real hardware as well! It's very weird actually, I don't remember that happening at all. Unless my PlayStation is too old (it only works when standing vertically actually), or maybe the disc I have has been compressed or had something modified to fit the 3 Crash games in it, but still, maybe this issue can't actually be fixed with PGXP. Some kind of ancient draw distance/LoD bias method? Here's some pics and video (got used to it now). I had to use a Windows Phone to record, and also sorry about my old 14" CRT, it sucks, but I still play my Wii on it XD.

Crash Bandicoot 3: Warped on real PlayStation. Original SCPH-1001 model, with the separate RCA inputs and parallel I/O port, if it interests. It also has that issue with the power supply being just under the CD drive, so over time it heated up the lens, its thin metal support dilated and shifted the lens focus, that's why it only works standing up.
Also some pics EDIT: The pics were too big :oops:.
Nice find with the terrain holes. So there is no problem with pgxp then. It's just a bug that was there in the first place.

I was wondering, what does pgxp work like on the jetski level? The Crash developers programmed a software z-buffer just for that level. So would pgxp like that or spit out corruptions?
 
#32 ·
I think the z-buffer is to prevent any z fighting on the water mesh. There's a lot of overlapping waves with transparency. Without a z-buffer, the ps1 doesn't know in what order front-to-back to show the polygons. So you would get a lot of flickering and flashing.

It's amazing the way Naughty Dog could levearage the Hardware potential of the ps1. Also, it looks good with pgxp.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top