From d14718daef9bf346fe29da2b681c35ff86db67ae Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 22 Sep 2010 08:26:54 +0200 Subject: [PATCH] force going all the way down when subsampling grates --- tools/quake3/q3map2/light.c | 1 + tools/quake3/q3map2/light_trace.c | 1 - tools/quake3/q3map2/light_ydnar.c | 7 +++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index b07314c0..882c7b65 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -758,6 +758,7 @@ int LightContributionToSample( trace_t *trace ) light = trace->light; /* clear color */ + trace->forceSubsampling = qfalse; /* to make sure */ VectorClear( trace->color ); VectorClear( trace->colorNoShadow ); VectorClear( trace->directionContribution ); diff --git a/tools/quake3/q3map2/light_trace.c b/tools/quake3/q3map2/light_trace.c index 73e69b03..5194962f 100644 --- a/tools/quake3/q3map2/light_trace.c +++ b/tools/quake3/q3map2/light_trace.c @@ -1781,7 +1781,6 @@ sets up certain trace values float SetupTrace( trace_t *trace ) { - trace->forceSubsampling = qfalse; VectorSubtract( trace->end, trace->origin, trace->displacement ); trace->distance = VectorNormalize( trace->displacement, trace->direction ); VectorCopy( trace->origin, trace->hit ); diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index ccbc54ad..c1bab3df 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -1817,6 +1817,13 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl /* sample light */ LightContributionToSample( trace ); + if(trace.forceSubsampling) + { + /* alphashadow: we subsample as deep as we can */ + ++lighted; + ++mapped; + ++mapped; + } /* add to totals (fixme: make contrast function) */ VectorCopy( trace->color, luxel[ b ] ); -- 2.39.2