fgsfdsfgs / sm64-port

PS2, PS3, OG Xbox and DOS ports of sm64-port.
https://discord.gg/7bcNTPK
243 stars 38 forks source link

Graphical Issues on Real HW #25

Open TechdudeGames opened 3 years ago

TechdudeGames commented 3 years ago

I have found a couple of issues when running the port on real PS2 hardware. These are the specs of my PS2 model: PS2 Model: SCPH-3001 Video Output: Component, but I did see this happen on AV@NTSC as well. Patches: None

In PCSX2 the game looks fine and runs as expected. On real hardware, however, I noticed there is a "bar" that appears to be tied somewhat to what is being drawn on-screen.

Ex: IMG_2370 https://youtu.be/DeYkKlVZT_k

Normally during regular gameplay, this bar isn't always present. Even when it is present it usually resides near the top of the screen. However, this bar became exaggerated when I modified gfx_ps2_init to set the game to run at 720p. I did have to disable double buffering to mitigate an even worse graphical bug at 720p. https://youtu.be/4AKpzemi8j4

I tested other homebrew applications running at NTSC, 480p, 720p, 1080i to make sure it wasn't my console at fault, and they worked just fine.

fgsfdsfgs commented 3 years ago

That bar does appear on 480i as well and I don't know the cause. It does seem to be related to full screen blended quads, like the one in the background of the pause menu. Maybe the blending makes it render slow enough that it runs over the vsync time? Since you don't have double-buffering, it's bound to produce artifacts like that.

TechdudeGames commented 3 years ago

The blending slowing down the render might be it, since the bar seems to move relative to the demand of things being drawn. At 720p that demand would be higher since the resolution has gone up. I was trying to see if double buffering solved the problem but when I enabled it the emulator would have a graphics flashing and the console did this: image

TechdudeGames commented 3 years ago

Curiously in the emulator at 720p it looks like it "flashes" on every other frame, and on the flash frames I can see geometry that would normally be drawn over.

fgsfdsfgs commented 3 years ago

I'm pretty sure high res modes require some sort of special handling, which I don't know the specifics of.

TechdudeGames commented 3 years ago

That sounds about right, given my experience trying to get the higher resolutions to work being curbed. I am very new to PS2 development but the graphics hardware seems to be very particular and finicky.

fgsfdsfgs commented 3 years ago

GSKit has a family of functions prefixed with gsKit_hires_. I took a brief look at the hires example they have and decided to not bother quite some time ago, but you can give it a shot.

TechdudeGames commented 3 years ago

I think I will take a stab at it and see if I can't get something working.

TechdudeGames commented 3 years ago

I think I might have found the culprit behind the glitchy bar. I wrote in simple check to make sure that the frame was done rendering so that vsync_callback wouldn't try and display the buffer. It actually fixed the issue, and it technically implements a sort of "frame skip". So I think the bar might be a result of the render not being completely finished before the vblank interrupt.

fgsfdsfgs commented 3 years ago

There's already sort of frameskip in the port, but it's done by just not rendering stuff unless there's time for it. If you think that fixed it, maybe you can make a PR?

TechdudeGames commented 3 years ago

I was just playtesting and I think it fixed it. I will see if I can't get a PR done in a little bit.

fgsfdsfgs commented 3 years ago

There is no rush.

TiagoAndreAlmeida commented 3 years ago

This happen on my model 90001 as well on this same stage, when balloon text appears, this happen too

lucaspontoexe commented 3 years ago

I tried messing with hires gsKit as well, just to see how it would go It only renders a part of the screen at 720p, though.

image

lucaspontoexe commented 3 years ago

(update: it works, I just had the wrong pass count at gsKit_hires_init_screen)

(update²: textures glitch in a few minutes of gameplay)

Aethusx commented 3 years ago

I tried messing with hires gsKit as well, just to see how it would go It only renders a part of the screen at 720p, though.

image

MARIO is gone

freshollie commented 10 months ago

Anyone manage to get HD working?