]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_particles.c
fixed bug where animated mdl skins (such as Tomaz's health box and
[xonotic/darkplaces.git] / cl_particles.c
index fb1c128284e49a56ccf3788955171b7f452eee07..033ea7067b72be6474044d8616b39d051d397df8 100644 (file)
@@ -2129,6 +2129,7 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
        R_Mesh_TexCoordPointer(0, 2, particle_texcoord2f, 0, 0);
        R_Mesh_ColorPointer(particle_color4f, 0, 0);
        GL_DepthMask(false);
+       GL_DepthRange(0, 1);
        GL_DepthTest(true);
        GL_CullFace(GL_FRONT); // quake is backwards, this culls back faces
 
@@ -2137,7 +2138,7 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
        {
                particletexture_t *tex;
                const float *org;
-               float up2[3], v[3], right[3], up[3], fog, ifog, cr, cg, cb, ca, size;
+               float up2[3], v[3], right[3], up[3], fog, cr, cg, cb, ca, size;
 
                p = cl.particles + surfacelist[surfacelistindex];
 
@@ -2168,13 +2169,13 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
                }
                if (r_refdef.fogenabled)
                {
-                       fog = VERTEXFOGTABLE(VectorDistance(p->org, r_view.origin));
-                       ifog = 1 - fog;
-                       cr = cr * ifog;
-                       cg = cg * ifog;
-                       cb = cb * ifog;
+                       fog = FogPoint_World(p->org);
+                       cr = cr * fog;
+                       cg = cg * fog;
+                       cb = cb * fog;
                        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;