]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_lightning.c
implemented support for GL_ARB_texture_compression - this is controlled
[xonotic/darkplaces.git] / r_lightning.c
index 0d287946dd794dee0e62e691cdda64afc92f6f3b..c8ff41f4eb8107dab90ba66459505ef257d23106 100644 (file)
@@ -216,13 +216,13 @@ void R_CalcLightningBeamPolygonTexCoord2f(float *tc, float t1, float t2)
 void R_FogLightningBeam_Vertex3f_Color4f(const float *v, float *c, int numverts, float r, float g, float b, float a)
 {
        int i;
-       float ifog;
+       float fog;
        for (i = 0;i < numverts;i++, v += 3, c += 4)
        {
-               ifog = 1 - VERTEXFOGTABLE(VectorDistance(v, r_view.origin));
-               c[0] = r * ifog;
-               c[1] = g * ifog;
-               c[2] = b * ifog;
+               fog = FogPoint_World(v);
+               c[0] = r * fog;
+               c[1] = g * fog;
+               c[2] = b * fog;
                c[3] = a;
        }
 }
@@ -239,6 +239,8 @@ void R_DrawLightningBeam_TransparentCallback(const entity_render_t *ent, const r
        R_Mesh_Matrix(&identitymatrix);
        GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
        GL_DepthMask(false);
+       GL_DepthRange(0, 1);
+       GL_PolygonOffset(r_refdef.polygonfactor, r_refdef.polygonoffset);
        GL_DepthTest(true);
        if (r_lightningbeam_qmbtexture.integer && r_lightningbeamqmbtexture == NULL)
                r_lightningbeams_setupqmbtexture();