]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light_ydnar.c
Merge branch 'dpkdir' into 'master'
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light_ydnar.c
index c9107407e3cf9c6c0b97c6f0a7e9c68d116521b8..5bb8438da0a5227b8dfb83ba4863da45862e51e0 100644 (file)
@@ -1492,6 +1492,7 @@ float DirtForSample( trace_t *trace ){
                        /* set endpoint */
                        VectorMA( trace->origin, dirtDepth, direction, trace->end );
                        SetupTrace( trace );
+                       VectorSet(trace->color, 1.0f, 1.0f, 1.0f);
 
                        /* trace */
                        TraceLine( trace );
@@ -1514,6 +1515,7 @@ float DirtForSample( trace_t *trace ){
                        /* set endpoint */
                        VectorMA( trace->origin, dirtDepth, direction, trace->end );
                        SetupTrace( trace );
+                       VectorSet(trace->color, 1.0f, 1.0f, 1.0f);
 
                        /* trace */
                        TraceLine( trace );
@@ -1527,6 +1529,7 @@ float DirtForSample( trace_t *trace ){
        /* direct ray */
        VectorMA( trace->origin, dirtDepth, normal, trace->end );
        SetupTrace( trace );
+       VectorSet(trace->color, 1.0f, 1.0f, 1.0f);
 
        /* trace */
        TraceLine( trace );
@@ -2213,7 +2216,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){
                        }
 
                        /* set luxel filter radius */
-                       luxelFilterRadius = superSample * filterRadius / lm->sampleSize;
+                       luxelFilterRadius = lm->sampleSize != 0 ? superSample * filterRadius / lm->sampleSize : 0;
                        if ( luxelFilterRadius == 0 && ( filterRadius > 0.0f || filter ) ) {
                                luxelFilterRadius = 1;
                        }
@@ -4248,6 +4251,7 @@ float FloodLightForSample( trace_t *trace, float floodLightDistance, qboolean fl
                        //VectorMA( trace->origin, 1, direction, trace->origin );
 
                        SetupTrace( trace );
+                       VectorSet(trace->color, 1.0f, 1.0f, 1.0f);
                        /* trace */
                        TraceLine( trace );
                        contribution = 1;