From 4bea57ea7eee48fb986eaa4ebebb906578ffec78 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 23 Dec 2007 21:17:50 +0000 Subject: [PATCH] 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 --- gl_rmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5