Open Magicql opened 5 years ago
This is a very old and known issue. It happens in NFS High Stakes too. Just disable perspective correct texturing.
iCatButler said that PGXP is going to be revamped sometime.
This isn't technically a bug within PGXP. It's caused by the developers playing around with perspective, presumably to make better use of the fixed point range available to them.
A lot of PS1 games will calculate transformation of various parts of the scene at different scales. For instance character models and items in Crash Bandicoot 3 are 4x the scale of the level geometry, but they're also positioned 4x as far from the viewer, so perspective makes them appear the correct size. This is one of the reasons why it's not possible to generate a proper z-buffer automatically for most PS1 games.
Insomniac use this trick in Spyro for characters and items, but they also use it for some of the terrain vertices when they're very close to the viewer. It's when these vertices share a triangle with vertices at a different scale that the perspective correction breaks down, technically that triangle is really big and stretches far into the distance. On real hardware the PS1 GPU has already discarded the depth information so it's not a problem.
Increasing depth is shown here as a colour from blue through green to red. Note how the objects and very close vertices have much greater depth than the nearby terrain.
There's a similar issue with Gran Turismo, which stitches the terrain together from patches, each of which use the full range of depth values available. So far the only ways I can think to fix it would be game specific hacks or a slider for rejecting perspective correction on triangles with a depth range exceeding some arbitrary size, neither of which is a great solution.
Ok then, so the textures glitch out because the GAME itself is applying different rules to triangles close to the viewer.
I dunno if this issue should remain open (to keep this discoverable and prevent duplicate issues) or closed because it's not PGXP's fault that this game is doing non-photorealistic transformations to certain vertices.
So far the only ways I can think to fix it would be game specific hacks or a slider for rejecting perspective correction on triangles with a depth range exceeding some arbitrary size, neither of which is a great solution.
Would be possible compare the depth range with the ordering table to get automatically the correct scale ?
Would be possible compare the depth range with the ordering table to get automatically the correct scale ?
Spyro doesn't seem to use ordering tables, it doesn't use DMA 6 (which clears the OT) and there don't seem to be any of the characteristic empty nodes in the data it sends to the GPU. Insomniac must have implemented their own method of sorting geometry instead.
So far the only ways I can think to fix it would be ...rejecting perspective correction on triangles with a depth range exceeding some arbitrary size...
Can you tell me where in the code I can implement this please. I would like to try it and see if this can solve the issue at least for Spyro and Gran Turismo 2, thanks
I have the latest version of RetroArch and Beetle PSX HW, and the issue is still there? Is something wrong with my setup?
@kosior555 - The bug hasn't been fixed. If you want to know why it happens, read iCatButler's comments.
@rz5 I read, but I wanted to make sure :) Let me add screenshots from Spyro 2 and 3, here it is the same with MEMORY + CPU turned on (at this moment the only way to get rid of texture gaps, the vertex cache gives a weak effect in my opinion) In this mode you could play, but this distortion is quite annoying to me, in addition, in Spyro 1 we get a strong freez when there is a portal in the field of view, and Spyro 2 and 3 are starting to experience minor menu issues. Videos: https://streamable.com/a2wx6 https://streamable.com/c6oj1 https://streamable.com/2oco6
@xzn Are you aware of this issue? Any ideas on how to fix it? If affects lots of games.
iCatButler said this about it (just see some posts above):
So far the only ways I can think to fix it would be game specific hacks or a slider for rejecting perspective correction on triangles with a depth range exceeding some arbitrary size, neither of which is a great solution.
@DonelBueno it's really as you said just turn off perspective texture for those games.
I tried implement iCB's second suggestion (reject perspective correction for polygons whose depth ranges are too high), it sort of works for Spyro but couldn't get it to work reliably for NFS High Stakes.
I don't have any other solution to this either.
@xzn I think rejecting too high depth ranges is only one of the possible checks. In NFS only quads seems to be affected by this issue: if there is a way to check if the quad isn't broken, I mean that the 4 xyz values are coherent, maybe NFS, GT2 and some other games will be "corrected".
When PGXP mode is enabled, some of the floor tiles close to the camera behind Spyro appear incorrectly rendered. The issue is constant and occurs on both memory only and memory + CPU modes, and on both GL and Vulkan renderers.
PGXP mode enabled:
PGXP mode disabled: