From 7d94bbaa451e955e17d6f746609de0d9f7f65784 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 27 Dec 2007 18:43:42 +0000 Subject: [PATCH] oops... could not have optimized this, putting back old code (fixes fog too bright bug at r_glsl 0, but contrastboost being set) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7870 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 3010d3c4..65d33757 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3250,12 +3250,12 @@ void R_UpdateFogColor(void) // needs to be called before HDR subrender too, as t if(r_glsl.integer && (r_glsl_contrastboost.value > 1 || r_glsl_contrastboost.value < 0)) // need to support contrast boost { // color.rgb /= ((ContrastBoost - 1) * color.rgb + 1); - fogvec[0] /= ((r_glsl_contrastboost.value - 1) * fogvec[0] + 1); - fogvec[1] /= ((r_glsl_contrastboost.value - 1) * fogvec[1] + 1); - fogvec[2] /= ((r_glsl_contrastboost.value - 1) * fogvec[2] + 1); + fogvec[0] *= r_glsl_contrastboost.value / ((r_glsl_contrastboost.value - 1) * fogvec[0] + 1); + 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); } // color.rgb *= ContrastBoost * SceneBrightness; - VectorScale(fogvec, r_glsl_contrastboost.value * r_view.colorscale, fogvec); + 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.2