dirtmapping: PROPERLY prevent hitting sky

This commit is contained in:
Rudolf Polzer 2010-10-30 16:36:53 +02:00
parent 4553078f35
commit aa00101d5e

View File

@ -1476,7 +1476,7 @@ float DirtForSample( trace_t *trace )
/* trace */ /* trace */
TraceLine( trace ); TraceLine( trace );
if( trace->opaque ) if( trace->opaque && !(trace->compileFlags & C_SKY) )
{ {
VectorSubtract( trace->hit, trace->origin, displacement ); VectorSubtract( trace->hit, trace->origin, displacement );
gatherDirt += 1.0f - ooDepth * VectorLength( displacement ); gatherDirt += 1.0f - ooDepth * VectorLength( displacement );
@ -1567,8 +1567,8 @@ void DirtyRawLightmap( int rawLightmapNum )
trace.recvShadows = lm->recvShadows; trace.recvShadows = lm->recvShadows;
trace.numSurfaces = lm->numLightSurfaces; trace.numSurfaces = lm->numLightSurfaces;
trace.surfaces = &lightSurfaces[ lm->firstLightSurface ]; trace.surfaces = &lightSurfaces[ lm->firstLightSurface ];
trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS; trace.inhibitRadius = 0.0f;
trace.testAll = qtrue; trace.testAll = qfalse;
/* twosided lighting (may or may not be a good idea for lightmapped stuff) */ /* twosided lighting (may or may not be a good idea for lightmapped stuff) */
trace.twoSided = qfalse; trace.twoSided = qfalse;