]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_lightning.c
implemented deferred rendering (r_shadow_deferred cvar) to accelerate
[xonotic/darkplaces.git] / r_lightning.c
index 7da3ee770bb66a62ef549f11e0f55a3892631114..212497a33e557a777dae149879c0a7af7b9cc85a 100644 (file)
@@ -215,20 +215,6 @@ 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 fog;
-       for (i = 0;i < numverts;i++, v += 3, c += 4)
-       {
-               fog = RSurf_FogVertex(v);
-               c[0] = r * fog;
-               c[1] = g * fog;
-               c[2] = b * fog;
-               c[3] = a;
-       }
-}
-
 float beamrepeatscale;
 
 void R_DrawLightningBeam_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
@@ -237,8 +223,7 @@ void R_DrawLightningBeam_TransparentCallback(const entity_render_t *ent, const r
        float vertex3f[12*3];
        float texcoord2f[12*2];
 
-       RSurf_ActiveCustomEntity(&identitymatrix, &identitymatrix, 0, 0, r_lightningbeam_color_red.value * r_refdef.view.colorscale, r_lightningbeam_color_green.value * r_refdef.view.colorscale, r_lightningbeam_color_blue.value * r_refdef.view.colorscale, 1, 12, vertex3f, texcoord2f, NULL, NULL, NULL, 6, r_lightningbeamelement3i, r_lightningbeamelement3s, false, false);
-       rsurface.fograngerecip = r_refdef.fograngerecip;
+       RSurf_ActiveCustomEntity(&identitymatrix, &identitymatrix, 0, 0, r_lightningbeam_color_red.value * r_refdef.view.colorscale, r_lightningbeam_color_green.value * r_refdef.view.colorscale, r_lightningbeam_color_blue.value * r_refdef.view.colorscale, 1, 12, vertex3f, texcoord2f, NULL, NULL, NULL, NULL, 6, r_lightningbeamelement3i, r_lightningbeamelement3s, false, false);
 
        if (r_lightningbeam_qmbtexture.integer && r_lightningbeamqmbtexture == NULL)
                r_lightningbeams_setupqmbtexture();
@@ -308,7 +293,7 @@ void R_DrawLightningBeam_TransparentCallback(const entity_render_t *ent, const r
                R_CalcLightningBeamPolygonTexCoord2f(texcoord2f + 16, t1 + 0.66, t2 + 0.66);
 
                // draw the 3 polygons as one batch of 6 triangles using the 12 vertices
-               R_DrawCustomSurface(r_lightningbeam_qmbtexture.integer ? r_lightningbeamqmbtexture : r_lightningbeamtexture, &identitymatrix, MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_FULLBRIGHT | MATERIALFLAG_NOCULLFACE, 0, 12, 0, 6, false);
+               R_DrawCustomSurface(r_lightningbeam_qmbtexture.integer ? r_lightningbeamqmbtexture : r_lightningbeamtexture, &identitymatrix, MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_FULLBRIGHT | MATERIALFLAG_NOCULLFACE, 0, 12, 0, 6, false, false);
        }
 }