Emulator Issues #1654
closedNew Super Mario Bross Wii only shows backgrounds textures if "disabled fog" setting is enabled
0%
Description
What steps will reproduce the problem?
- New Super Mario Bross wii is not showing background textures.
What is the expected output? What do you see instead?
I expected to see background textures. I can't see background textures with
default settings. Same issue with directx and opengl plugin.
What version of the product are you using? On what operating system?
I'm using Dolphin x64 r4532 on windows 7 64.
Amd Athlon 64 x2 4200+, Radeon HD4850 512 MB, 4 GB ram.
Please provide any additional information below.
Enabling "disable fog" in opengl settings background textures will appear.
Here are some screenshots:
Directx 9 (no background):
http://i600.photobucket.com/albums/tt88/fjavier2k/mariobros_dx9.jpg
OpenGl (no background):
http://i600.photobucket.com/albums/tt88/fjavier2k/mariobros_ogl.jpg
OpenGL + Disable fog (background appears):
http://i600.photobucket.com/albums/tt88/fjavier2k/mariosbros_ogl_fogdisable
d.jpg
Updated by Anonymous about 15 years ago
reminds me of the issues that were in SMG, until an initialized variable in the shaders
was set to 0....
Updated by Autoran1 about 15 years ago
BTW on old revs it also shows background if SMG hack is enabled
Updated by masterkillua123 about 15 years ago
if you select disable fog in the world menu, you only can see the map but "white".
So, need be fix more.
Updated by XTra.KrazzY about 15 years ago
- Status changed from New to Invalid
Disable fog is a hack, and as such any weird effects caused by enabling it is your
responsibility.
Updated by sl1nk3.s about 15 years ago
- Status changed from Invalid to Questionable
I don't think this is Invalid, graphics appear ONLY when fog is disabled, so there's
something wrong here for sure !
Updated by ChaosCode about 15 years ago
Tino/rodo was saying it looked like an unsupported fog type. Doesn't matter, game is
unplayable till the hle plugin is fixed.
Updated by ChaosCode about 15 years ago
- Status changed from Questionable to Accepted
Updated by bbxc65 about 15 years ago
someone in the forum wrote it does work with the LLE sound plugin enabled. but it's
too slow for me to test
Updated by luisr142004 about 15 years ago
if you disable the dual-core option it'll be fullspeed :)
Updated by bbxc65 about 15 years ago
i'm single core user, so it's standard turned off
Updated by fgfemperor about 15 years ago
Ok, so this is my first attempt to mess with Dolphin's code...
Since I'm no expert at that, after a while messing with it, I figured out the following:
At PixelShaderManager.cpp, line 209, on NSMB, the value for bpmem.fog.a.GetA() is too high (around 6) while on other games (SSB
and Mario Kart Wii) it's way below 1...
I tried to understand why it was happening, but got a little confused on that GetA() method... It doesn't seem to be the problem
though...
So, my hack (and a pretty ugly one, I might add) is that I changed:
SetPSConstant4f(C_FOG + 1, a, b, bpmem.fog.c_proj_fsel.GetC(), 0);
to:
if(a < 2)
SetPSConstant4f(C_FOG + 1, a, b, bpmem.fog.c_proj_fsel.GetC(), 0);
else
SetPSConstant4f(C_FOG + 1, 0.0, 1.0, 1.0, 0);
And it worked... Still got the fog on games like SSB and the background is showing on NSMB...
But I know we should have fog on NSMB, so the problem is that somehow, bpmem.fog.a.GetA() is returning the wrong value...
Just hope I pointed someone in the right direction... Sorry I couldn't do more than that though...
Updated by BhaaL about 15 years ago
Without looking at the surrounding code (and probably not knowing what it actually
does): a value of 6 in places where a float is wanted? Maybe that value should be
clamped into 0.0 to 1.0 range, by /10.f (or even /100.f)?
Updated by fgfemperor about 15 years ago
I got it... The problem wasn't on GetA after all...
PixelShaderManager.cpp line 209
from:
float a = bpmem.fog.a.GetA() * ((float)(1 << bpmem.fog.b_shift));
to:
float a = bpmem.fog.a.GetA() * ((float)(1 << (bpmem.fog.b_shift - 1)));
If you guys want, I can create a patch...
So now we got fog on SSBB, NSMB and all the other games, while still having the
background showing on NSMB \o/
btw: I don't just guessed it... I got it from BPMemory.h:679 that says:
u32 b_shift; // b's exp + 1?
Updated by fgfemperor about 15 years ago
With the previous hack: http://img709.imageshack.us/img709/6963/nofog.jpg
With the new hack (fix?): http://img692.imageshack.us/img692/6822/yesfog.jpg
Updated by fjavier2k about 15 years ago
I see that in first screenshot you are getting 53 fps, but with the new hack you're
getting only 29 fps (second screenshot). Seems a big performance drop. If you could
take a look at the performance drop would be perfect.
Anyway, any patch to solve this issue will be welcome :) Thanks fgfemperor.
Updated by fgfemperor about 15 years ago
Hmm actually I was using a lot of CPU with other programs open when I took the second
screenshot... After I closed it all I noticed no performance drop whatsoever!
Also, it's just a subtraction, it shouldn't affect performance at all!
Anyway here's the patch! =)
Updated by death2droid about 15 years ago
Interesting......
Which games have you tested this with.
Updated by death2droid about 15 years ago
Also does it fix it in the OpenGL plugin as well.
Updated by fjavier2k about 15 years ago
Great! I've tried the fogfix.patch and now I can finally see the fog in NSMB!
Someone should add the fix patch in the next svn.
Updated by death2droid about 15 years ago
Just need to make sure this doesn't break any games.
Updated by fgfemperor about 15 years ago
Well I've tested this on Mario Kart Wii, Super Smash Bros. Brawl, Paper Mario, Mario
Galaxy and, of course, New Super Mario Bros. Wii... Also this works for both OpenGL and
Direct3D.
Also, I think it shouldn't break any games... From my point of view, thw worst that
could happen is a game losing its fog...
Updated by bztdlinux about 15 years ago
- Status changed from Accepted to Accepted
- Issue type set to Bug
- Operating system N/A added
This is not a GameIssue, rather a bug in Dolphin.
Updated by hrydgard about 15 years ago
Patch looks good, go ahead and submit. You got access, fgfemperor.
Updated by fgfemperor about 15 years ago
- Status changed from Accepted to Fixed
Wow, thanks! Just committed it... Guess I can close this now, right?