]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_light.c
Too fine an AREA_GRID seems to be dropping performance in normal quake maps (I hope...
[xonotic/darkplaces.git] / r_light.c
index 48ef2cdd0a3a4c51ddcffc0ba200ddde28d60266..7aea7676db72c8c440fa41aac65ac0fd4d4997e7 100644 (file)
--- a/r_light.c
+++ b/r_light.c
@@ -656,7 +656,7 @@ void R_ModelLightPoint (const entity_render_t *ent, vec3_t color, const vec3_t p
 {
        mleaf_t *leaf;
        leaf = Mod_PointInLeaf(p, cl.worldmodel);
-       if (!leaf || leaf->contents == CONTENTS_SOLID || r_fullbright.integer || !cl.worldmodel->lightdata || ent->effects & EF_FULLBRIGHT)
+       if (!leaf || leaf->contents == CONTENTS_SOLID || !cl.worldmodel->lightdata)
        {
                color[0] = color[1] = color[2] = 1;
                return;
@@ -691,7 +691,11 @@ void R_LightModel(const entity_render_t *ent, int numverts, float *vertices, flo
        // scale of the model's coordinate space, to alter light attenuation to match
        // make the mscale squared so it can scale the squared distance results
        mscale = ent->scale * ent->scale;
-       if ((maxnearlights != 0) && !r_fullbright.integer && !(ent->effects & EF_FULLBRIGHT))
+       if (r_fullbright.integer || (ent->effects & EF_FULLBRIGHT))
+               VectorSet(basecolor, 1, 1, 1);
+       else if (maxnearlights == 0 && r_shadow_lightingmode < 2)
+               R_CompleteLightPoint (basecolor, ent->origin, true, NULL);
+       else
        {
                R_ModelLightPoint(ent, basecolor, ent->origin);
 
@@ -824,8 +828,6 @@ void R_LightModel(const entity_render_t *ent, int numverts, float *vertices, flo
                        }
                }
        }
-       else
-               R_CompleteLightPoint (basecolor, ent->origin, true, NULL);
        basecolor[0] *= colorr;
        basecolor[1] *= colorg;
        basecolor[2] *= colorb;