From: lordhavoc Date: Sat, 18 Nov 2000 01:05:02 +0000 (+0000) Subject: light only the front faces, cuts down on noticable visdata anomolies X-Git-Tag: RELEASE_0_2_0_RC1~937 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a38d9172688be1574719c0ef9f788b0ba6ce48a1;p=xonotic%2Fdarkplaces.git light only the front faces, cuts down on noticable visdata anomolies git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@83 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_light.c b/r_light.c index bb50a11c..3bbf6b56 100644 --- a/r_light.c +++ b/r_light.c @@ -121,12 +121,15 @@ loc0: surf = cl.worldmodel->surfaces + node->firstsurface; for (i=0 ; inumsurfaces ; i++, surf++) { - if (surf->dlightframe != r_dlightframecount) // not dynamic until now + if (((surf->flags & SURF_PLANEBACK) == 0) == ((PlaneDist(lightorigin, surf->plane)) >= surf->plane->dist)) { - surf->dlightbits[0] = surf->dlightbits[1] = surf->dlightbits[2] = surf->dlightbits[3] = surf->dlightbits[4] = surf->dlightbits[5] = surf->dlightbits[6] = surf->dlightbits[7] = 0; - surf->dlightframe = r_dlightframecount; + if (surf->dlightframe != r_dlightframecount) // not dynamic until now + { + surf->dlightbits[0] = surf->dlightbits[1] = surf->dlightbits[2] = surf->dlightbits[3] = surf->dlightbits[4] = surf->dlightbits[5] = surf->dlightbits[6] = surf->dlightbits[7] = 0; + surf->dlightframe = r_dlightframecount; + } + surf->dlightbits[bitindex] |= bit; } - surf->dlightbits[bitindex] |= bit; } if (node->children[0]->contents >= 0) @@ -220,7 +223,7 @@ void R_VisMarkLights (vec3_t lightorigin, dlight_t *light, int bit, int bitindex if (surf->visframe != r_framecount || surf->lightframe == lightframe) continue; surf->lightframe = lightframe; - //if (((surf->flags & SURF_PLANEBACK) == 0) == ((PlaneDiff(lightorigin, surf->plane)) >= 0)) + if (((surf->flags & SURF_PLANEBACK) == 0) == ((PlaneDist(lightorigin, surf->plane)) >= surf->plane->dist)) { if (surf->dlightframe != r_dlightframecount) // not dynamic until now {