diff options
author | Dave Parks <davep@lindenlab.com> | 2011-09-26 18:31:55 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-09-26 18:31:55 -0500 |
commit | 54ba56dbe995a3d215f85932c83948145a871ac4 (patch) | |
tree | c6162c3b56599db1b21f707e1c8b0b6f04a85064 /indra/newview/llvosky.cpp | |
parent | 56191701bcbc0ef1b6872cc6bfac1d18f636fd12 (diff) |
SH-2244 changes to run in a core context on AMD hardware without generating deprecation or performance warnings
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r-- | indra/newview/llvosky.cpp | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index d90c3be6c7..e9db37821b 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -2040,9 +2040,12 @@ void LLVOSky::updateFog(const F32 distance) { if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG)) { - glFogf(GL_FOG_DENSITY, 0); - glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV); - glFogf(GL_FOG_END, 1000000.f); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogf(GL_FOG_DENSITY, 0); + glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV); + glFogf(GL_FOG_END, 1000000.f); + } return; } @@ -2112,7 +2115,10 @@ void LLVOSky::updateFog(const F32 distance) if (camera_height > water_height) { LLColor4 fog(render_fog_color); - glFogfv(GL_FOG_COLOR, fog.mV); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogfv(GL_FOG_COLOR, fog.mV); + } mGLFogCol = fog; if (hide_clip_plane) @@ -2120,13 +2126,19 @@ void LLVOSky::updateFog(const F32 distance) // For now, set the density to extend to the cull distance. const F32 f_log = 2.14596602628934723963618357029f; // sqrt(fabs(log(0.01f))) fog_density = f_log/fog_distance; - glFogi(GL_FOG_MODE, GL_EXP2); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogi(GL_FOG_MODE, GL_EXP2); + } } else { const F32 f_log = 4.6051701859880913680359829093687f; // fabs(log(0.01f)) fog_density = (f_log)/fog_distance; - glFogi(GL_FOG_MODE, GL_EXP); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogi(GL_FOG_MODE, GL_EXP); + } } } else @@ -2146,24 +2158,27 @@ void LLVOSky::updateFog(const F32 distance) fogCol.setAlpha(1); // set the gl fog color - glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV); mGLFogCol = fogCol; // set the density based on what the shaders use fog_density = water_fog_density * gSavedSettings.getF32("WaterGLFogDensityScale"); - glFogi(GL_FOG_MODE, GL_EXP2); + + if (!LLGLSLShader::sNoFixedFunction) + { + glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV); + glFogi(GL_FOG_MODE, GL_EXP2); + } } mFogColor = sky_fog_color; mFogColor.setAlpha(1); - LLGLSFog gls_fog; - - glFogf(GL_FOG_END, fog_distance*2.2f); - - glFogf(GL_FOG_DENSITY, fog_density); + LLDrawPoolWater::sWaterFogEnd = fog_distance*2.2f; if (!LLGLSLShader::sNoFixedFunction) { + LLGLSFog gls_fog; + glFogf(GL_FOG_END, fog_distance*2.2f); + glFogf(GL_FOG_DENSITY, fog_density); glHint(GL_FOG_HINT, GL_NICEST); } stop_glerror(); |