]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
oops... could not have optimized this, putting back old code (fixes fog too bright...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Dec 2007 18:43:42 +0000 (18:43 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Dec 2007 18:43:42 +0000 (18:43 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7870 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 3010d3c415f52b40de5cbce22a0d377b957149c1..65d3375723c3fa05dab822f3115087b7c2378af0 100644 (file)
@@ -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);