Dolphin, the GameCube and Wii emulator - Forums

Full Version: Conditional EFB scaling to fix bloom
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
If I have time, I'll update the PR and try again. The PR also needs default .ini options for games that can be helped by it, but I don't have a big library of games that I can go through to test.

I couldn't find an explanation of what cemu does to fix bloom. All I saw were very different major bloom issues.

wade_lazlo

(08-21-2020, 01:46 PM)One More Try Wrote: [ -> ]If I have time, I'll update the PR and try again.  The PR also needs default .ini options for games that can be helped by it, but I don't have a big library of games that I can go through to test.

I couldn't find an explanation of what cemu does to fix bloom.  All I saw were very different major bloom issues.

Not sure if this is the right thread for this but I found the EFB copy size slider handy for Lord of the Rings: Aragorn's Quest, higher than 81 pixels works to fix bloom from torches and characters etc as far as I've seen. Nice work thanks.

Would include images but not sure how to.

Hopefully this can be pulled back into the main Dolphin code soon.
Even though I know it probably won't happen because it's technically a "hack" I would love to see this in the official dolphin builds. As far as I'm concerned this is the single biggest issue effecting visual quality in most popular titles.
Hi, concerning the PR with this slider (https://github.com/dolphin-emu/dolphin/pull/7533), I'd like to try and help resolve merge conflicts so the option is available on more recent builds supporting the latest fixes if you don't mind. I'm very new at this so don't know how hard it will be totally but the changes seem to be mergeable after some familiarisation.
For what it's worth, this feature is available in Ishiiruka if you want to use it. I'd personally like to see us look into proper downsampling for higher IR to see how that impacts things before merging this into Dolphin.
(01-02-2022, 12:30 PM)iwubcode Wrote: [ -> ]For what it's worth, this feature is available in Ishiiruka if you want to use it.  I'd personally like to see us look into proper downsampling for higher IR to see how that impacts things before merging this into Dolphin.

Thanks for pointing this out. I tested it and unfortunately the current version of Ishiiruka doesn't work with the DS4Windows DSU server I'm using to have motion controls via a DualShock 4 controller. I agree that proper downsampling is most likely the way to go but this solution works really well in the interim and solved the extreme amounts of ghosting the game I tested had, which would be great as an option for people to have with a working build. I didn't want to bother One More Try on the new year hence suggesting to attempt a merge to master myself.
Writing this out as a separate reply for clearer visibility: I've updated One More Try's code (Original code) to work with the latest version of Dolphin (new code with before/after screenshots in the PR). I've attached a build to this post you can just extract into your existing Dolphin folder and then just run Dolphin_EFBSlider.exe. It won't interfere with your existing setup as it is named differently and is compatible with the latest changes. Enjoy!
(01-03-2022, 09:42 AM)gordonfreeman01 Wrote: [ -> ]Writing this out as a separate reply for clearer visibility: I've updated One More Try's code (Original code) to work with the latest version of Dolphin (new code with before/after screenshots in the PR). I've attached a build to this post you can just extract into your existing Dolphin folder and then just run Dolphin_EFBSlider.exe. It won't interfere with your existing setup as it is named differently and is compatible with the latest changes. Enjoy!

I've been maintaining the EFB slider version and integrated some enhancements as mentioned on the PR. To make it easier for people to use this if they wish to without rebuilding on their own, I'll be posting updated binaries from time to time.

The current release is here: https://github.com/gordonfreeman01/dolph...5.0-16118e

All releases can be found here (only 1 so far): https://github.com/gordonfreeman01/dolphin/releases

The file to download if you just want to play is the .7z file in the release page. Source code is marked as such on the release entry.

This is a complete build of Dolphin so you just need to extract the 7-zip file to use it (no need to replace the binary in an existing setup). The 7z file will extract to a folder called "x64" and in it launch Dolphin.exe. It will use your existing Dolphin profile (shared across Dolphin instances on your system) so you should be ready to rock.

To use the EFB Slider:
  1. Launch your game and reach a point where bloom issues happen (manifests as ghosting on areas that should be glowing such as around lamps and neon effects)
  2. Click on Graphics
  3. Go to the Advanced Tab and scroll down to the "Scaled EFB Copy Exclusions" section
  4. Click on Enabled (read the tooltip when you mouse over)
  5. Move the sliders as described in the tooltips when you mouse over them to fix the bloom while your game is running (change value, check the game visuals). Typically increase the Width from 0 to a higher value, leave Height to 0 and set "Exclude based on Width AND Height" to Disabled until the bloom stops looking like ghosting on the image. The game instantly updates when you change the values (as with other Graphics settings).
Of note, this system often works but not always and while awaiting a full solution for this thorny problem, it's a rather magical experience enhancement across tonnes of games. See the PR for comparison screenshots.

Values found so far (unless otherwise specified these have "Height" < 0 and "Exclude based on Width AND Height" Disabled):
1. Star Wars The Clone Wars Lightsaber Duels - Width < 81
2. Code Lyoko: Quest for Infinity - Width < 81
3. Monster Hunter Tri - Width < 321 (Thanks Narugakuruga), alternatively try https://dolphin-emu.org/blog/2020/10/05/...gust-2020/
4. Tron Evolution: Battle Grids (this game really needs this) - Width < 161
5. Sonic Colors (has issues) - Width < 162, Height < 121, Exclude based on Width AND Height enabled - Bloom effects work BUT depending on the camera angle and size of Sonic on screen, it can cause pixelation on Sonic's lower half or Sonic completely although in motion that would be for a split second most of the time.

If anyone has ideas/expertise to help fix these scaled bloom problems please do step in and help, it's very much worth it! Several developers are looking/have looked at this problem and it definitely isn't an easy fix. I'm sure all help is appreciated (even other emulators such as PPSSPP have trouble with this). Also, if you have any bloom bugs that aren't documented please add them to the bugtracker with the required information so it is easier to find solutions.
I think this is the correct approach. My only other thought is to detect when efb copies are being pasted on top of each other with offsets, since that's how most bloom is created, but there'd probably be more weird outliers/inliers than looking at sizes.

Hopefully the PR gets accepted. Xenoblade (81) and Mario Kart (160 or higher to blur more effects) work with it too.

/edit Actually, I might have thought of a fix for games like Metroid that have the wrong efb copies included. Since bloom typically compounds efb copies on top of the same image, the dst address usually stays the same for each one.  So if you want to filter further, you can record the dst pointer, check it on the next efb copy, and only apply the scaling fix if it is the same (and below the slider threshold). This would probably get metroid and maybe sonic working right.  You could go past that and say most bloom writes 2 or more times, so wait for dst to be the same 3 times in a row, but then there's a problem of having to wait for the 3rd copy before triggering scaling. The good thing about just checking if the dst is the same once, is that it only skips the first bloom efb copy, which should not impact the final image. The first efb copy would be downscaled for use in the second bloom copy that triggers the filtering.  You may want it as an extra option, but it's a simple thing to just code in the same place as the efb slider and try out.

Code:
 if (width < g_ActiveConfig.iEFBExclude && g_ActiveConfig.iEFBExcludeEnabled && !is_xfb_copy && m_bloom_dst_check == dst)
 {
   scaled_tex_w = tex_w;
   scaled_tex_h = tex_h;
 }

 m_bloom_dst_check = dst;

and declare m_bloom_dst_check as a nullptr in the h file.  It might not need an option to toggle, would need to test on all the known blooms though.

/edit Tested on sonic and metroid using fifo recordings. Metroid is definitely fixed, as the top-left corner stays high-res even with the efb slider maxed out, and the bloom switches from high to low res as you move the slider. Sonic looks fixed as well, but I know you need to play with camera angles for awhile to fully test and I only have the fifo atm.
Last note, Mario Kart always changes the dst, so it would have to be an option. May remove the need for a height slider, if no other games can be found that need height and aren't fixed with the dst check..
Pages: 1 2 3 4 5 6 7