New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top Gear - graphical glitches with sprite occlusion on the road #303
Comments
I don't know if this helps, but I tested |
I was able to reproduce the issue and I can confirm that it doesn't happen on a real SNES. I have been looking into how the game hides parts of the sprite but I don't understand it yet. |
Thank you for taking your time and confirming the issue. Let me know if there is any way I can help. |
The game hides parts of sprites by adding many off-screen sprites that still take up time to fetch so that there is no time left to fetch the sprites which should be hidden. These off-screen sprites are 16x16 with X position -256(or 256) so these should take 4 pixel cycles to fetch but the core only takes 2 pixel cycles to fetch these sprites. This trace shows sprite 46 takes 4 pixel cycles to fetch which is correct because it is a 16x16 sprite with X position 97. Sprite 47-51 are 16x16 off-screen sprites but only take 2 pixel cycles to fetch which should be 4 cycles. Here is a save state for Mesen-S: |
Nice, thank you for this info! |
There is a check here that skips to the next sprite if the next tile is off-screen. The Line 1569 in be0cfc8
@srg320 Do you remember why this check is done? It doesn't seem to match a real SNES with Top Gear. If I remove @Kopert Can you test this build with other games? |
Thank you for the build, @paulb-nl. I tested it on about a dozen games keeping my eyes up anything that looked out of place and couldn't find anything. Click to see list of games tested on 2021/11/26 with SNES_Sprite.rbf
My main concern is that the issue with Top Gear was very hard to perceive in the first place, so there's a chance that any issues your changes would introduce would easily escape my notice. Ideally we'd know why the I will continue using your build as my daily driver so if anything out of place pops up I'll let you know. Thanks again! |
The sprite test rom I made does show that the SNES only fetches the visible tiles so that's why that TILE_X+8 check is there. Only when a sprite is set to X position -256/256 then it does fetch all the tiles even though the sprite is completely off-screen. |
I'm out of my depth here, but would that be just a case of replacing |
That doesn't work because Also it would not skip the next tile of a sprite if the next tile starts at 256. |
better to wait for release, then test and close if fixed. |
Tested with release 21.12.14. Could not reproduce the issue anymore. Thanks for the fix! |
I don't know if sprite occlusion is the correct term, I don't know how it is actually implemented. Anyway:
Core: SNES_20210713.rbf
ROM: NO-Intro, Top Gear (USA).sfc, MD5 e5040a079ff03eb93747424af9be75f4
Issue: Sometimes sprites still show up when they're supposed to be occluded by the road, for example, when going downhill.
Here are two images that show the problem:
On these images, taken near the last turn on the first level (Las Vegas, U.S.A), you can see a left-turn signal that should be hidden by the road. I've noticed this on other levels with other sprites, including cars.
I do not have an actual SNES to test this one, but I have checked this video taken from the actual console and I've tested it on the bsnes_mercury_accuracy RetroArch core, and the issue does not appear on either case.
The text was updated successfully, but these errors were encountered: