Small update for disabled Fog for older hardware that fails to divide by zero in shaders

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7612 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2011-06-20 05:48:12 +00:00
parent bc416a552e
commit 693f276a68

View file

@ -232,9 +232,8 @@ void PixelShaderManager::SetConstants()
SetPSConstant4f(C_FOG + 1, bpmem.fog.a.GetA(), b, bpmem.fog.c_proj_fsel.GetC(), b_shf); SetPSConstant4f(C_FOG + 1, bpmem.fog.a.GetA(), b, bpmem.fog.c_proj_fsel.GetC(), b_shf);
} }
else else
{
SetPSConstant4f(C_FOG + 1, 0.0, 1.0, 0.0, 1.0); SetPSConstant4f(C_FOG + 1, 0.0, 1.0, 0.0, 1.0);
}
s_bFogParamChanged = false; s_bFogParamChanged = false;
} }
@ -254,6 +253,9 @@ void PixelShaderManager::SetConstants()
// so to simplify i use the hi coeficient as K in the shader taking 256 as the scale // so to simplify i use the hi coeficient as K in the shader taking 256 as the scale
SetPSConstant4f(C_FOG + 2, ScreenSpaceCenter, (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)), bpmem.fogRange.K[4].HI / 256.0f,0.0f); SetPSConstant4f(C_FOG + 2, ScreenSpaceCenter, (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)), bpmem.fogRange.K[4].HI / 256.0f,0.0f);
} }
else
SetPSConstant4f(C_FOG + 2, 0.0f, 1.0f, 1.0f, 0.0f); // Need to update these values for older hardware that fails to divide by zero in shaders.
s_bFogRangeAdjustChanged = false; s_bFogRangeAdjustChanged = false;
} }