libretro / gpsp

gpSP for libretro.
GNU General Public License v2.0
52 stars 52 forks source link

[Top Gear Rally] Masked elements are visible #191

Closed DrUm78 closed 1 year ago

DrUm78 commented 1 year ago

Hardware: Tested on RG350P (mips32r2) and FunKey S (armv7) handhelds. Software: Libretro core and standalone port.

Description: Some layer priority issues happen in Top Gear Rally (see screenshots). Indeed, some elements (trees, signs, cars...) are visible whereas the track should hide them while they are behind.

Steps to reproduce:

  1. Launch Top Gear Rally
  2. Start any race
  3. Notice that you see some elements through the track whereas they should be hidden

Expected behavior: The track should always hide the elements that are behind it.

IMG_0040 IMG_0042 IMG_0191

davidgfnet commented 1 year ago

Do you know if ReGBA has the same issue on this game? I know that console whips ReGBA as default GBA emu (IIRC). Thanks!

DrUm78 commented 1 year ago

@davidgfnet Yep that's the same on RG350 (mips32r2) with this OPK: https://github.com/Ninoh-FOX/ReGBA

andymcca commented 1 year ago

Possibly a sprite layer issue? mgba had something similar on this game (sprites being drawn in the wrong order) -

https://github.com/mgba-emu/mgba/issues/485

andymcca commented 1 year ago

Having recently reviewed the video.c code, I suspect this is the same OBJ transparency bug as is being experienced in issues #74, #207 and #210.

Transparent OBJs aren't being handled correctly by the current code. See issue #74 for more explanation.

andymcca commented 1 year ago

@DrUm78 - ok, we figured this one out. It uses the sprite cycle limit to pack the appropriate scanlines with off-screen Window OBJs so that other cars further along the track and other sprites 'invisible' due to being obscured by a hill or corner etc are not displayed due to being above the number of sprites that can be displayed on those scan lines.

Trouble is, gpsp doesn't currently implement the sprite cycle limit 😆

David will implement this on the ongoing video renderer rewrite (this will solve numerous other issues!), and so this will be fixed once that is merged (soon).

DrUm78 commented 1 year ago

Awesome news guys, thanks for the hard work, can't wait to test it. 👍

davidgfnet commented 1 year ago

Merged the new video renderer code which accounts for OBJ/Sprite rendering cycles. So this is now finally fixed.

DrUm78 commented 1 year ago

Confirmed, it's now fixed, thanks a lot for the new renderer!