From: havoc Date: Fri, 27 Nov 2009 15:31:58 +0000 (+0000) Subject: more work on mod_generatelightmaps: X-Git-Tag: xonotic-v0.1.0preview~1122 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7b6f7fdf7194eb66fe973b473ab385e035984070;p=xonotic%2Fdarkplaces.git more work on mod_generatelightmaps: don't accept lights behind a surface, they mess up shading git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9524 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_shared.c b/model_shared.c index 1635e087..faec4c5a 100644 --- a/model_shared.c +++ b/model_shared.c @@ -3219,6 +3219,9 @@ static void Mod_GenerateLightmaps_SamplePoint(const float *pos, const float *nor { //R_SampleRTLights(pos, sample, numoffsets, offsets); VectorSubtract(lightinfo->origin, pos, relativepoint); + // don't accept light from behind a surface, it causes bad shading + if (normal && DotProduct(relativepoint, normal) <= 0) + continue; dist2 = VectorLength2(relativepoint); if (dist2 >= lightinfo->radius2) continue;