From: divverent Date: Sun, 23 Dec 2007 21:17:50 +0000 (+0000) Subject: the formula for fog was right... note that it uses the unsimplified formula, as preca... X-Git-Tag: xonotic-v0.1.0preview~2638 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4bea57ea7eee48fb986eaa4ebebb906578ffec78;p=xonotic%2Fdarkplaces.git the formula for fog was right... note that it uses the unsimplified formula, as precalculating stuff isn't needed here git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7853 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 18cf387c..45134017 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3248,6 +3248,7 @@ void R_UpdateFogColor(void) // needs to be called before HDR subrender too, as t vec3_t fogvec; VectorCopy(r_refdef.fogcolor, fogvec); // color.rgb *= SceneBrightness; + VectorScale(fogvec, r_view.colorscale, fogvec); if(r_glsl.integer && (r_glsl_contrastboost.value > 1 || r_glsl_contrastboost.value < 0)) // need to support contrast boost { // color.rgb *= ContrastBoost / ((ContrastBoost - 1) * color.rgb + 1); @@ -3255,7 +3256,6 @@ void R_UpdateFogColor(void) // needs to be called before HDR subrender too, as t fogvec[1] *= r_glsl_contrastboost.value / ((r_glsl_contrastboost.value - 1) * fogvec[1] + 1); fogvec[2] *= r_glsl_contrastboost.value / ((r_glsl_contrastboost.value - 1) * fogvec[2] + 1); } - VectorScale(fogvec, r_view.colorscale, fogvec); r_refdef.fogcolor[0] = bound(0.0f, fogvec[0], 1.0f); r_refdef.fogcolor[1] = bound(0.0f, fogvec[1], 1.0f); r_refdef.fogcolor[2] = bound(0.0f, fogvec[2], 1.0f);