]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
oops... fog is now colorscaled, so handle this correctly. Now fog + HDR works again.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 11 Dec 2007 08:03:24 +0000 (08:03 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 11 Dec 2007 08:03:24 +0000 (08:03 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7784 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c
gl_rmain.c
r_sky.c

index a12e6844ab841ac60716182de6b58074b5d1e9c7..9d6c538e3d5a2cf3f45e910d0a7156c9847a2760 100644 (file)
@@ -2253,9 +2253,9 @@ void R_DrawDecal_TransparentCallback(const entity_render_t *ent, const rtlight_t
                        //if (blendmode == PBLEND_ALPHA)
                        //{
                        //      fog = 1 - fog;
-                       //      cr += r_refdef.fogcolor[0] * fog * r_view.colorscale;
-                       //      cg += r_refdef.fogcolor[1] * fog * r_view.colorscale;
-                       //      cb += r_refdef.fogcolor[2] * fog * r_view.colorscale;
+                       //      cr += r_refdef.fogcolor[0] * fog;
+                       //      cg += r_refdef.fogcolor[1] * fog;
+                       //      cb += r_refdef.fogcolor[2] * fog;
                        //}
                }
                c4f[0] = c4f[4] = c4f[8] = c4f[12] = cr;
@@ -2396,9 +2396,9 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
                        if (blendmode == PBLEND_ALPHA)
                        {
                                fog = 1 - fog;
-                               cr += r_refdef.fogcolor[0] * fog * r_view.colorscale;
-                               cg += r_refdef.fogcolor[1] * fog * r_view.colorscale;
-                               cb += r_refdef.fogcolor[2] * fog * r_view.colorscale;
+                               cr += r_refdef.fogcolor[0] * fog;
+                               cg += r_refdef.fogcolor[1] * fog;
+                               cb += r_refdef.fogcolor[2] * fog;
                        }
                }
                c4f[0] = c4f[4] = c4f[8] = c4f[12] = cr;
index 052059570d81502753bc7a299209320e2250c0a2..50026747f8413cbc06f147772fe5f6a744d299fc 100644 (file)
@@ -3850,7 +3850,7 @@ void R_DrawSprite(int blendfunc1, int blendfunc2, rtexture_t *texture, rtexture_
                R_Mesh_TexBind(0, R_GetTexture(fogtexture));
                GL_BlendFunc(blendfunc1, GL_ONE);
                fog = 1 - fog;
-               GL_Color(r_refdef.fogcolor[0] * fog * r_view.colorscale, r_refdef.fogcolor[1] * fog * r_view.colorscale, r_refdef.fogcolor[2] * fog * r_view.colorscale, ca);
+               GL_Color(r_refdef.fogcolor[0] * fog, r_refdef.fogcolor[1] * fog, r_refdef.fogcolor[2] * fog, ca);
                R_Mesh_Draw(0, 4, 2, polygonelements, 0, 0);
        }
 }
diff --git a/r_sky.c b/r_sky.c
index 9bd6992cec649c772c6c7a2c3ea13f2f96c51bf4..b870bdaaf83ef9fe362b9859df3e8c252d1c2c81 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -290,7 +290,7 @@ static void R_SkyBox(void)
        if(r_refdef.fogenabled)
        {
                GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-               GL_Color(r_refdef.fogcolor[0] * r_view.colorscale, r_refdef.fogcolor[1] * r_view.colorscale, r_refdef.fogcolor[2] * r_view.colorscale, 1 - FogForDistance(r_refdef.fog_end));
+               GL_Color(r_refdef.fogcolor[0], r_refdef.fogcolor[1], r_refdef.fogcolor[2], 1 - FogForDistance(r_refdef.fog_end));
                for (i = 0;i < 6;i++)
                {
                        R_Mesh_TexBind(0, 0);
@@ -425,7 +425,7 @@ static void R_SkySphere(void)
        {
                R_Mesh_TexBind(0, 0);
                GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-               GL_Color(r_refdef.fogcolor[0] * r_view.colorscale, r_refdef.fogcolor[1] * r_view.colorscale, r_refdef.fogcolor[2] * r_view.colorscale, 1 - FogForDistance(r_refdef.fog_end));
+               GL_Color(r_refdef.fogcolor[0], r_refdef.fogcolor[1], r_refdef.fogcolor[2], 1 - FogForDistance(r_refdef.fog_end));
                GL_LockArrays(0, skysphere_numverts);
                R_Mesh_Draw(0, skysphere_numverts, skysphere_numtriangles, skysphere_element3i, 0, 0);
                GL_LockArrays(0, 0);