Emulator Issues #9649
closedIncorrectly calculated shadows in SpongeBob: BfBB
0%
Description
Game Name?
SpongeBob SquarePants: Battle for Bikini Bottom
Game ID? (right click the game in the game list, properties, info tab)
GQPE78
MD5 Hash? (right click the game in the game list, properties, info tab, MD5 Hash: Compute)
9e18f9a0032c4f3092945dc38a6517d3
What's the problem? Describe what went wrong.
Shadows are overly opaque and red + blue outline is sometimes present in the top left corner of the screen as well as some of the game edges.
I've combined bug reports because I'm fairly confident they're the same issue.
What steps will reproduce the problem?
Only present on internal resolutions greater than 1x or when Anti-aliasing is enabled:
Blue box in upper left appears when NOT looking at objects that require dynamic shading. The game is calculating shadows underneath a texture from the EFB (a copy of what's supposed to be there). The texture copy either doesn't cover the shadow projection properly, resulting in a blurred edge. Possibly a format discrepancy that's causing loss of information.
Shadows are red translucent triangles (matching the floor polygons) in a square surrounding spongebob.
With wireframe mode, projection hacks, or variable editing, you can manipulate the buffer up there, but never enough to remove it. See screenshots
Consistent test zone is the main menu where all degrees of all the issues happen.
Which versions of Dolphin did you test on? Does using an older version of Dolphin solve your issue? If yes, which versions of Dolphin used to work?
4-9000 - 5.0-88
What are your PC specifications? (CPU, GPU, Operating System, more)
Windows 7
Intel Xeon X5472
NVIDIA Quadro FX 4600
Windows 10
Intel i7 (first gen can't remember)
Nvidia GTX 540M
Is there any other relevant information? (e.g. logs, screenshots,
configuration files)
Included are several screenshots + FIFO replay. Settings are default everything.
Files
Updated by JMC4789 over 8 years ago
Some games don't support higher internal resolutions in Dolphin due to precision issues. This is one of them.
If there are no issues at 1x Internal Resolution then there's not likely anything that can be done. (see: Sonic Heroes/Shadow the Hedgehog for other examples of games that can't be rendered at higher resolutions properly.)
Updated by escape336 over 8 years ago
scizzer12 wrote:
With wireframe mode, projection hacks, or variable editing, you can manipulate the buffer up there, but never enough to remove it.
Tada!
043CD020 00000000
043CD048 00000000
043CD04C 00000000
04914D14 00000000
That's an AR code I made a little while back. Removes a bunch of shadow-based effects, but still removes the blue box at any resolution, with or without Scaled EFB Copies:
Updated by escape336 over 8 years ago
JMC4789 wrote:
Some games don't support higher internal resolutions in Dolphin due to precision issues. This is one of them.
If there are no issues at 1x Internal Resolution then there's not likely anything that can be done. (see: Sonic Heroes/Shadow the Hedgehog for other examples of games that can't be rendered at higher resolutions properly.)
The box is actually still there at all resolutions, but it's just covered up at all times by an EFB copy of the area of the screen behind it (why they didn't just remove the box, we may never know.)
Updated by escape336 over 8 years ago
Also, the box is not present in the PS2 or Xbox versions, for whatever reason.
Updated by JMC4789 over 8 years ago
Should I close this issue then? Or is there anything else to say about it?
Updated by scizzer12 over 8 years ago
JMC4789 wrote:
Should I close this issue then? Or is there anything else to say about it?
I don't know if removing shadows is really a solution.
I mean, I wrote an AR code that stretches the EFB copy 1 extra pixel (and still keeps shadows) and I wouldn't call that a solution. It leaves a seam because the textures don't line up properly but as soon as I find the X,Y offset, that shouldn't be an issue.
If we accept there is no solution and never will be (like moving the EFB copy layer back behind everything, fixing the edge blending, increasing the calculation size of the ground shadows so large that nobody can see them, etc) then I guess we could close it, but I feel like that'd be giving up. This issue is also present in the sequel (the spongebob movie game) and a solution could set a precedent for similar solutions with rounding issues in other games.
Updated by escape336 over 8 years ago
JMC4789 wrote:
Should I close this issue then? Or is there anything else to say about it?
This doesn't seem to be an issue with emulation, but an inherent issue with the scaling of IR/EFB copies. As I said, the box is in fact there on console, but you can't see it.
Updated by scizzer12 over 8 years ago
- File GQPE78-1.png GQPE78-1.png added
- File GQPE78-2.png GQPE78-2.png added
- File GQPE78-3.png GQPE78-3.png added
- File GQPE78-4.png GQPE78-4.png added
So I found something(s) interesting.
When I changed one of the offset values I noticed that the box in the top is correct only when there's more than one shadow being calculated. Since the rounding error seems to be because the game doesn't place every calculation box at the same exact location. Look at screenshots 1-3. They're all offset by a lot. Normally this is only by a pixel or a subpixel for every object.
I also made something temporary that moves the graphical stripe to the top-left where it's significantly less noticeable. (Screenshot 4)
========Current fix=======
$1.5x & 2x iR
043CD048 437F8000 <-EFB overlay to 255.5px
043CD04C 3A562BF1 <-EFB overlay scale multiplier
04914D14 000000F8 <-Shadow calc box size X to 248
04914D18 000000F8 <-Shadow calc box size y to 248
04914D48 00000000 <-Shadow texture to grey
$Other iR (Not perfect. Just moves the seam to the edge of the screen)
043CD048 43800000 <-EFB overlay to 255.5px
043CD04C 00000000 <-EFB overlay scale multiplier (couldn't find one without rounding errors)
04914D14 000000F8 <-Shadow calc box size X to 248
04914D18 000000F8 <-Shadow calc box size y to 248
04914D48 00000000 <-Shadow texture to grey
Also something to reduce shadow artifacts (at the expense of quality)
$Shadow simplifier
043CD054 45800000 <-Shadow Display size (8x smaller)
043CD01C BD800000 <-Shadow Scale (8x larger)
043CD020 43000000 <-Shadow opacity (50%)
Updated by JMC4789 over 8 years ago
Maybe put the codes on the wiki and then I'll close this issue :)
Updated by iwubcode over 7 years ago
Please see my fix here: https://github.com/dolphin-emu/dolphin/pull/4715 ; turn on "Vertex Rounding"!
Updated by JMC4789 over 7 years ago
- Status changed from New to Fixed
This is (mostly )fixed by enabling the Vertex Rounding Hack OR using 1x IR... pick your poison.
Updated by pokechu22 about 2 years ago
- Related to Emulator Issues #10551: Spongebob the Movie floor texture/shadow issues and transparent box added
Updated by pokechu22 about 2 years ago
Fixed by https://github.com/dolphin-emu/dolphin/pull/9989 (with a game patch and vertex rounding both enabled by default); see https://dolphin-emu.org/blog/2021/09/07/dolphin-progress-report-august-2021/#50-14810-50-14848-and-50-15105-gameini-heavy-iron-studios-games-quality-of-life-changes-by-the-community-and-developers