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
Implement EFB Peeks for compressed z16 formats #9673
Conversation
|
Perhaps the second example should be included into Fifoci |
|
It cannot be, for the results get baked into the fifolog. We already checked for that. |
|
This seems to only affect Rogue Squadron 3. I pushed this through a big part of my library of games that do EFB Access, and it just doesn't seem to catch anything at all. No fixes, no regressions, no nothing. Just Rogue Squadron 3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unfamiliar with how the hardware works here, but the in-source explanation makes sense to me.
|
To be clear, I didn't do hardware testing here. The data format was documented from REed Z16 decompression/compression functions decompiled from game code (that appear to be originally from the Gamecube SDK) I don't know if it's 100% correct, but It's close enough to make RE3 behave correctly. |
|
There is a TODO for checking for compressed z16 format changes in BPFunctions.cpp -> OnPixelFormatChange() I am assuming "special compression format" means ZFAR, if that's the case could you add Star Wars:RS3 to the comment? |
ZFAR, ZMID and ZNEAR are the 3 options for "special compression format", on top of ZLINEAR. I've updated the TODO to be more accurate and have more up-to-date infomation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the first three commits should probably be squashed together
This fixes an issue in RS3 where engine lens flares would shine though ships during cutscenes
|
Squashed, ready for merge |
Dolphin doesn't correctly emulate 3xMSAA mode. It probably never will as it's kind of pointless when users can just force everything to have 4xMSAA or 16xMSAA or even stupidly high Internal Resolutions.
Besides, Not many games uses the 3xMSAA mode. It's a real pain to use when it cuts the vertical EFB resolution in half to 640x264, requiring multiple passes to get a complete 4:3 frame.
But Rogue Squadron uses it. Actually, Factor 5 cheap out and only uses it during cutscenes. They cheap out even further by rendering many of those cutscenes in a "cinematic widescreen" aspect ratio with a resolution of 512x264 that just so happens to fit inside a single 3xMSAA EFB buffer.
Dolphin's trickery is usually hidden from games. Except RS3 also directly accesses the EFB framebuffer to check the occlusion of engine exhaust plumes. This was previously working in main gameplay, but in cutscenes dolphin would return the wrong depth and the occlusion query would always pass, resulting in the lens flare effect shining though solid objects.
Dolphin had some previous code to automatically convert from Z24 to Z16 formats during an efb peek, but it was hardcoded to the Linear format, while RS3 uses the ZFAR compressed Z16 format.
This PR implements the compressed Z16 formats, which fixes this visual glitch in RS3 cutscenes.
Screenshots:
Before
After
Before
After