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
GameINI: SpongeBob SquarePants: Battle For Bikini Bottom Quality of Life settings #9989
Conversation
4685ee5
to
59fafd0
Compare
|
For what it's worth, the addresses I'm overwriting has "0.001953125" or 3B 00 00 00 in Hex in them. By overwriting them with 00 00 00 00, you fix the offset and make the game render correctly regardless of resolution. |
|
What's specifically happening is that the game is rendering to a 256 by 256 area at the top-left of the screen to generate shadows, but at higher IRs, this is offset slightly. The game then tries to render an EFB copy over the shadow thing it previously rendered, which also gets offset. The game is actually trying to compensate for this offsetting by changing the texture coordinate by 1/512 (which is 0.001953125), which works except that it requires wrapping around on the texture. Since the texture is configured to repeat, you get the stuff at the top of the screen instead, which is jarring; had they not configured it to repeat, there would still be some graphical artifacts, but less so. Importantly, all of these proposed result in identical rendering 1x IR, so this change doesn't introduce accuracy problems. Here are some high-resolution (8x IR) screenshots:
And with vertex rounding enabled:
My conclusion here: the game is actually trying to compensate for some sort of offsetting at higher IRs, and would succeed at it except for the effect not quite fitting properly and thus triggering texture wrapping. However, when it creates an EFB for shadows, it picks up stuff outside of the region where it was drawing, resulting in bad graphics; thus, the Vertex Rounding hack needs to be used. But if Vertex Rounding is enabled, the offset correction the game is already doing ends up being incorrect, since it's actually drawing at an offset of 0 now; thus, the game also needs to be patched to use an offset of 0. This also fixes the texture wrapping issue. In short, Vertex Rounding + the patch is the way to get correct rendering at higher IRs. Testing noteTo get consistent images, I used the hardware fifoplayer in Dolphin. To disable wrapping, I wrote 6180200000 at 00017816 (in Object 78). To apply the patch, I wrote 98000400000000000000003f7fffffffffffff000000000000000000000000438000003f7fffffffffffff000000003f80000043800000000000003f7fffffffffffff3f8000000000000043800000438000003f7fffffffffffff3f8000003f800000 at 000178f6 (in Object 79); this uses coordinates of 0 and 1 instead of 0.001953125 and 1.00195 and was copied from a fifolog recorded with the patch. To see the shadows, I disabled geometry for Object 79. |
03be8c1
to
3639590
Compare
This enables Vertex Rounding Hack and has a game patch for two bugs resulting from game choices. The game draws an efb copy at coordinate 0.00195313 to 1.00195 repeating which only works due to how the numbers work out at low resolution. The Vertex Rounding Hack is a null operation on 1x IR, so there should be no concern enabling it by default since higher resolutions are completely broken without it.








This enables Vertex Rounding Hack and has a game patch for two bugs resulting from game choices. The game draws an EFB copy from texture coordinate 0.00195313 to 1.00195 repeating which only works due how to the numbers work out at low resolution.
The Vertex Rounding Hack is a null operation on 1x IR, so there should be no concern enabling it by default since higher resolutions are completely broken without it.
I spent all day testing the game and got nearly to the end with no crashes nor major graphical glitches at 4x internal resolution. The PAL version of the patch I developed myself based on the NTSC version of the patch, which was based on the Action Replay code on the wiki - https://wiki.dolphin-emu.org/index.php?title=SpongeBob_SquarePants:_Battle_for_Bikini_Bottom