gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
774 stars 181 forks source link

Auxiliary color buffers to RDRAM issues #882

Open AmbientMalice opened 8 years ago

AmbientMalice commented 8 years ago

Basically, games that have aux buffer shadows are sometimes badly corrupted. Interestingly, Jet Force Gemini is the opposite, and the shadows are broken without aux to RDRAM.

gliden64_conker_bfd_000

gliden64_conker_bfd_001

gliden64_turok_3 _shadow_of_o_000

gliden64_turok_3 _shadow_of_o_001

AmbientMalice commented 8 years ago

Just want to note that this is still an issue. And I think it's possibly the root cause of Pokemon Snap not working.

It looks like some sort of buffer clearing bug? For example, in Turok 3, characters start out with normal looking shadows. But when they rotate or run around, their shadows smear. It's like the plugin is writing semi-transparent layers on top of the existing buffer instead of replacing it. This probably only affects textures with some sort of alpha, though, like shadows.

Beanow commented 7 years ago

The same issue occurs when using traditional frame buffer emulation. Without using the new feature. Notice that the corruption pattern is also exactly the same. So it looks like the copy feature may not be the main issue here.

No HWFBE Old FBs

[Video-GLideN64]

# Enable frame and|or depth buffer emulation.
EnableFBEmulation = False
# Copy auxiliary buffers to RDRAM
EnableCopyAuxiliaryToRDRAM = False

HWFBE + Aux copy FBs & aux copy

[Video-GLideN64]

# Enable frame and|or depth buffer emulation.
EnableFBEmulation = True
# Copy auxiliary buffers to RDRAM
EnableCopyAuxiliaryToRDRAM = True

HWFBE only FBs only

[Video-GLideN64]

# Enable frame and|or depth buffer emulation.
EnableFBEmulation = True
# Copy auxiliary buffers to RDRAM
EnableCopyAuxiliaryToRDRAM = False
Beanow commented 7 years ago

@AmbientMalice it's definitely a buffer clearing bug of sorts. When you enable 4x multi-sampling, I can see artefacts around the edges of the shadow, which do update as normal every frame, except it never clears existing data. However it does overwrite the black artefacts with grey if the shadow moves over them.

Stacked shadows

To make matters worse, it seems the buffers are re-used for different models as well. For example this robot here.

Big bot

If you get a good look at him and let him render many frames worth of shadow, then go to the dogs, this is what you get.

Bot filled the shadow

The entire buffer now has grey and black on the background, much larger than the dogs shadows could ever have become. You get much less of this if you go past the robot as quickly as possible and avoid looking in that direction.