PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.84k stars 1.63k forks source link

[GSdx hardware bug] Jackie Chan Adventures flickering and improper cel shading effect #1824

Closed ssakash closed 1 year ago

ssakash commented 7 years ago

Description of the issue:

Note:

gregory38 commented 7 years ago

Of course, you tested on the native resolution. Could be rounding issue or maybe alpha test issue. If you're motivated you can dump all the states (save and dump option) to find a wrong draw call and see what happen exactly.

FlatOutPS2 commented 7 years ago

D3D9 doesn't even render half of the screen.

This issue also affects D3D11 and OpenGL at upscaled resolutions if you go the the Plugin Settings, and then resume the emulation.

gregory38 commented 7 years ago

@ssakash Could it be related to #1838 ? Picking the wrong depth buffer can cause missing shadow.

MrCK1 commented 7 years ago

@ssakash I suppose the Unscale Point Line hack could be useful for the flickering? Not sure about the cel shading in general. I own Cartoon Network Racing which also uses cel shading and IIRC, the effect isn't reproduced properly in HW renderer as well.

AmbientMalice commented 7 years ago

Worth noting XIII's cel shading isn't correct in HW renderer, either.

ghost commented 2 years ago

Preload frame data Fixes some Upscaling issues in this game

coornio commented 2 years ago

This is one game to absolutely hate for its hardware mode bugs. Attempted a few tests on my own and here are the results.

The PFD (Preload Frame Data) hack helps a bit with the issues later seen, but causes troubles in the main menu, as observed here: gs_20220719204301_Jackie Chan Adventures_SCES-52412.gs.zip gs_20220719204301_Jackie Chan Adventures_SCES-52412

Similarly, regardless of the aforementioned hack, hardware mode specifically appears to flash a big black rectangle when transitioning into the save menu. Multi-frame, no screenshot: gs_20220719204313_Jackie Chan Adventures_SCES-52412.gs.zip

Into actual gameplay, there's two major offenders in hardware rendering. First is the shadows. They do not occlude properly, so they clip through geometry (intro gameplay cinematic shows this best with Jackie on the second floor jumping down). Shadows also apparently only render when the camera is within a certain yaw range, completely hidden otherwise. Lastly, they cut off at points for no good reason.

Small shot in software mode where Jackie's doing an animation. You'll see it looks fine, but when you load the dump, the shadow of his right left is nowhere to be seen in hardware mode: gs_20220719205242_Jackie Chan Adventures_SCES-52412.gs.zip gs_20220719205242_Jackie Chan Adventures_SCES-52412

On another note, you'll also notice in the picture above that the left edge of the screen is a line of garbage pixels. It only happens in software mode, and doesn't appear in hardware mode at all.

This is another dump showcasing how the shadow disappears once the camera yaw crosses a certain point, as if there's some weird, invisible hard boundary in the way. Multi-frame, no picture: gs_20220719205637_Jackie Chan Adventures_SCES-52412.gs.zip

The second major issue has to do with outlines and geometry occlusion. As mentioned previously, PFD helps a bit, but the game still suffers from some weird occlusion issue that undoes most of its own and the issue appears to be isolated to the top half of the screen, perhaps the top right half. I can't be certain in this one map alone. Here follows another multi-frame dump that showcases this effect, no picture: https://www.mediafire.com/file/sli7jvjjqopc592/gs_20220719205356_Jackie+Chan+Adventures_SCES-52412.gs.xz/file

ghost commented 1 year ago

the right side of the trees is really messed up. image

Both the ps3 and the ps4 Emulate the gs correctly in this game, i wonder what the reason might be on pcsx2, I think the gs is drawing stuff that the developers of the game didn't intend to be visible to players

ghost commented 1 year ago

Seems that EE Cycle skipping also reduces artifacts but EXTREMELY slightly, These images are from the same angle.

Normal Cycle: image

Cycle skipping set to 2, Focus on the first tiki. image

I Also remember that this game refused to boot on opl, it required mode 2 (Synchronous mode), might not be related but idk,

The Glitch appears as you move away from the trees, but as you get closer it goes away.

it's extremely strange, the left side is working perfectly, but the right side is not.

stenzek commented 1 year ago

Fixed in #8606. For the record, it was nothing to do with anything on the EE or alpha testing. Game renders the main at 1280x448, then downsamples it to 640x448, the depth is done in two halves, offsetting TBP0 for the second (same as 10 Pin and Miami Vice).

The shadows were broken because it re-uses a previous C32 target pointer as a Z16S depth buffer, but it does clear it inbetween. So we need to remove the 32-bit flag on the clear.