diff options
| author | gnick79 <gnick79@gmail.com> | 2010-11-23 13:57:01 +0000 |
|---|---|---|
| committer | gnick79 <gnick79@gmail.com> | 2010-11-23 13:57:01 +0000 |
| commit | 4267adbd5e6f79d1ce5804c7a32dbf3ce65f0531 (patch) | |
| tree | 46854609a6d74608d9070e0fa44bdd8dabb4bf2f /Source/Core/VideoCommon/Src/PixelShaderManager.cpp | |
| parent | b0c94a47f97e4233cd12574db0b5f9680a588b26 (diff) | |
Related FOG changes:
* revert back to proper upscale mantissa of parameters A and C
* properly downscale magnitude to 0.24 bits instead than ≡0.23
* Z Eyespace conversion for projection by original patent concept
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6463 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index e0bad16ee5..9d4f2d6cec 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -201,9 +201,11 @@ void PixelShaderManager::SetConstants() { if(!g_ActiveConfig.bDisableFog) { - float a = bpmem.fog.a.GetA() * ((float)(1 << (bpmem.fog.b_shift - 1))); - float b = ((float)bpmem.fog.b_magnitude / 8388638) * ((float)(1 << (bpmem.fog.b_shift - 1))); - SetPSConstant4f(C_FOG + 1, a, b, bpmem.fog.c_proj_fsel.GetC(), 0); + //downscale magnitude to 0.24 bits + float b = (float)bpmem.fog.b_magnitude / 0xFFFFFF; + + float b_shf = (float)(1 << bpmem.fog.b_shift); + SetPSConstant4f(C_FOG + 1, bpmem.fog.a.GetA(), b, bpmem.fog.c_proj_fsel.GetC(), b_shf); } else { |
