From 4eddff1519f73d32d72031d3b1011c72dfdd9802 Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 11 Dec 2007 08:03:24 +0000 Subject: [PATCH] oops... fog is now colorscaled, so handle this correctly. Now fog + HDR works again. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7784 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_particles.c | 12 ++++++------ gl_rmain.c | 2 +- r_sky.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cl_particles.c b/cl_particles.c index a12e6844..9d6c538e 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -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; diff --git a/gl_rmain.c b/gl_rmain.c index 05205957..50026747 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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 9bd6992c..b870bdaa 100644 --- 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); -- 2.39.2