X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Flight_ydnar.c;h=bf5bc36c34b90a72d785696daa837368e45f7918;hp=dc4c692fd3d792327e13b243fd929b5a74177eed;hb=b104009ba6cc6b24202a686ca53a3be5264833bf;hpb=382e2da9a032c4b7cda4de9d3aa5043794118a88 diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index dc4c692f..bf5bc36c 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -120,6 +120,14 @@ void ColorToBytes( const float *color, byte *colorBytes, float scale ) /* compensate for ingame overbrighting/bitshifting */ VectorScale( sample, (1.0f / lightmapCompensate), sample ); + + /* sRGB lightmaps */ + if(lightmapsRGB) + { + sample[0] = floor(Image_sRGBFloatFromLinearFloat(sample[0] * (1.0 / 255.0)) * 255.0 + 0.5); + sample[1] = floor(Image_sRGBFloatFromLinearFloat(sample[1] * (1.0 / 255.0)) * 255.0 + 0.5); + sample[2] = floor(Image_sRGBFloatFromLinearFloat(sample[2] * (1.0 / 255.0)) * 255.0 + 0.5); + } /* store it off */ colorBytes[ 0 ] = sample[ 0 ]; @@ -1154,13 +1162,18 @@ void MapRawLightmap( int rawLightmapNum ) if( MapQuad( lm, info, dv ) ) continue; - /* get drawverts and map first triangle */ - MapTriangle( lm, info, dv, mapNonAxial ); - - /* get drawverts and map second triangle */ - dv[ 1 ] = &verts[ pw[ r + 2 ] ]; - dv[ 2 ] = &verts[ pw[ r + 3 ] ]; - MapTriangle( lm, info, dv, mapNonAxial ); + for( mapNonAxial = 0; mapNonAxial < 2; mapNonAxial++ ) + { + /* get drawverts and map first triangle */ + dv[ 1 ] = &verts[ pw[ r + 1 ] ]; + dv[ 2 ] = &verts[ pw[ r + 2 ] ]; + MapTriangle( lm, info, dv, mapNonAxial ); + + /* get drawverts and map second triangle */ + dv[ 1 ] = &verts[ pw[ r + 2 ] ]; + dv[ 2 ] = &verts[ pw[ r + 3 ] ]; + MapTriangle( lm, info, dv, mapNonAxial ); + } } } @@ -1471,7 +1484,7 @@ float DirtForSample( trace_t *trace ) /* trace */ TraceLine( trace ); - if( trace->opaque ) + if( trace->opaque && !(trace->compileFlags & C_SKY) ) { VectorSubtract( trace->hit, trace->origin, displacement ); gatherDirt += 1.0f - ooDepth * VectorLength( displacement ); @@ -1562,8 +1575,8 @@ void DirtyRawLightmap( int rawLightmapNum ) trace.recvShadows = lm->recvShadows; trace.numSurfaces = lm->numLightSurfaces; trace.surfaces = &lightSurfaces[ lm->firstLightSurface ]; - trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS; - trace.testAll = qtrue; + trace.inhibitRadius = 0.0f; + trace.testAll = qfalse; /* twosided lighting (may or may not be a good idea for lightmapped stuff) */ trace.twoSided = qfalse; @@ -1714,7 +1727,9 @@ static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float //% normal2 = SUPER_NORMAL( x, y ); } else - Sys_Printf( "WARNING: Spurious lightmap S vector\n" ); + { + Error( "Spurious lightmap S vector\n" ); + } VectorSubtract( origin2, origin, originVecs[ 0 ] ); //% VectorSubtract( normal2, normal, normalVecs[ 0 ] ); @@ -1773,14 +1788,15 @@ SubsampleRawLuxel_r() recursively subsamples a luxel until its color gradient is low enough or subsampling limit is reached */ -static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampleOrigin, int x, int y, float bias, float *lightLuxel ) +static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampleOrigin, int x, int y, float bias, float *lightLuxel, float *lightDeluxel ) { int b, samples, mapped, lighted; int cluster[ 4 ]; vec4_t luxel[ 4 ]; + vec3_t deluxel[ 3 ]; vec3_t origin[ 4 ], normal[ 4 ]; float biasDirs[ 4 ][ 2 ] = { { -1.0f, -1.0f }, { 1.0f, -1.0f }, { -1.0f, 1.0f }, { 1.0f, 1.0f } }; - vec3_t color, total; + vec3_t color, direction = { 0, 0, 0 }, total; /* limit check */ @@ -1817,7 +1833,7 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl /* sample light */ LightContributionToSample( trace ); - if(trace->forceSubsampling) + if(trace->forceSubsampling > 1.0f) { /* alphashadow: we subsample as deep as we can */ ++lighted; @@ -1827,6 +1843,10 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl /* add to totals (fixme: make contrast function) */ VectorCopy( trace->color, luxel[ b ] ); + if(lightDeluxel) + { + VectorCopy( trace->directionContribution, deluxel[ b ] ); + } VectorAdd( total, trace->color, total ); if( (luxel[ b ][ 0 ] + luxel[ b ][ 1 ] + luxel[ b ][ 2 ]) > 0.0f ) lighted++; @@ -1841,7 +1861,7 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl { if( cluster[ b ] < 0 ) continue; - SubsampleRawLuxel_r( lm, trace, origin[ b ], x, y, (bias * 0.5f), luxel[ b ] ); + SubsampleRawLuxel_r( lm, trace, origin[ b ], x, y, (bias * 0.5f), luxel[ b ], lightDeluxel ? deluxel[ b ] : NULL ); } } @@ -1849,12 +1869,20 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl //% VectorClear( color ); //% samples = 0; VectorCopy( lightLuxel, color ); + if(lightDeluxel) + { + VectorCopy( lightDeluxel, direction ); + } samples = 1; for( b = 0; b < 4; b++ ) { if( cluster[ b ] < 0 ) continue; VectorAdd( color, luxel[ b ], color ); + if(lightDeluxel) + { + VectorAdd( direction, deluxel[ b ], direction ); + } samples++; } @@ -1865,10 +1893,85 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl color[ 0 ] /= samples; color[ 1 ] /= samples; color[ 2 ] /= samples; - + /* add to color */ VectorCopy( color, lightLuxel ); lightLuxel[ 3 ] += 1.0f; + + if(lightDeluxel) + { + direction[ 0 ] /= samples; + direction[ 1 ] /= samples; + direction[ 2 ] /= samples; + VectorCopy( direction, lightDeluxel ); + } + } +} + +/* A mostly Gaussian-like bounded random distribution (sigma is expected standard deviation) */ +static void GaussLikeRandom(float sigma, float *x, float *y) +{ + float r; + r = Random() * 2 * Q_PI; + *x = sigma * 2.73861278752581783822 * cos(r); + *y = sigma * 2.73861278752581783822 * sin(r); + r = Random(); + r = 1 - sqrt(r); + r = 1 - sqrt(r); + *x *= r; + *y *= r; +} +static void RandomSubsampleRawLuxel( rawLightmap_t *lm, trace_t *trace, vec3_t sampleOrigin, int x, int y, float bias, float *lightLuxel, float *lightDeluxel ) +{ + int b, mapped; + int cluster; + vec3_t origin, normal; + vec3_t total, totaldirection; + float dx, dy; + + VectorClear( total ); + VectorClear( totaldirection ); + mapped = 0; + for(b = 0; b < lightSamples; ++b) + { + /* set origin */ + VectorCopy( sampleOrigin, origin ); + GaussLikeRandom(bias, &dx, &dy); + + /* calculate position */ + if( !SubmapRawLuxel( lm, x, y, dx, dy, &cluster, origin, normal ) ) + { + cluster = -1; + continue; + } + mapped++; + + trace->cluster = cluster; + VectorCopy( origin, trace->origin ); + VectorCopy( normal, trace->normal ); + + LightContributionToSample( trace ); + VectorAdd( total, trace->color, total ); + if(lightDeluxel) + { + VectorAdd( totaldirection, trace->directionContribution, totaldirection ); + } + } + + /* add to luxel */ + if( mapped > 0 ) + { + /* average */ + lightLuxel[ 0 ] = total[ 0 ] / mapped; + lightLuxel[ 1 ] = total[ 1 ] / mapped; + lightLuxel[ 2 ] = total[ 2 ] / mapped; + + if(lightDeluxel) + { + lightDeluxel[ 0 ] = totaldirection[ 0 ] / mapped; + lightDeluxel[ 1 ] = totaldirection[ 1 ] / mapped; + lightDeluxel[ 2 ] = totaldirection[ 2 ] / mapped; + } } } @@ -1881,19 +1984,21 @@ illuminates the luxels #define STACK_LL_SIZE (SUPER_LUXEL_SIZE * 64 * 64) #define LIGHT_LUXEL( x, y ) (lightLuxels + ((((y) * lm->sw) + (x)) * SUPER_LUXEL_SIZE)) +#define LIGHT_DELUXEL( x, y ) (lightDeluxels + ((((y) * lm->sw) + (x)) * SUPER_DELUXEL_SIZE)) void IlluminateRawLightmap( int rawLightmapNum ) { - int i, t, x, y, sx, sy, size, llSize, luxelFilterRadius, lightmapNum; + int i, t, x, y, sx, sy, size, luxelFilterRadius, lightmapNum; int *cluster, *cluster2, mapped, lighted, totalLighted; + size_t llSize, ldSize; rawLightmap_t *lm; surfaceInfo_t *info; qboolean filterColor, filterDir; float brightness; float *origin, *normal, *dirt, *luxel, *luxel2, *deluxel, *deluxel2; unsigned char *flag; - float *lightLuxels, *lightLuxel, samples, filterRadius, weight; - vec3_t color, averageColor, averageDir, total, temp, temp2; + float *lightLuxels, *lightDeluxels, *lightLuxel, *lightDeluxel, samples, filterRadius, weight; + vec3_t color, direction, averageColor, averageDir, total, temp, temp2; float tests[ 4 ][ 2 ] = { { 0.0f, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } }; trace_t trace; float stackLightLuxels[ STACK_LL_SIZE ]; @@ -2007,10 +2112,15 @@ void IlluminateRawLightmap( int rawLightmapNum ) { /* allocate temporary per-light luxel storage */ llSize = lm->sw * lm->sh * SUPER_LUXEL_SIZE * sizeof( float ); + ldSize = lm->sw * lm->sh * SUPER_DELUXEL_SIZE * sizeof( float ); if( llSize <= (STACK_LL_SIZE * sizeof( float )) ) lightLuxels = stackLightLuxels; else lightLuxels = safe_malloc( llSize ); + if(deluxemap) + lightDeluxels = safe_malloc( ldSize ); + else + lightDeluxels = NULL; /* clear luxels */ //% memset( lm->superLuxels[ 0 ], 0, llSize ); @@ -2084,6 +2194,8 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* setup */ memset( lightLuxels, 0, llSize ); + if(deluxemap) + memset( lightDeluxels, 0, ldSize ); totalLighted = 0; /* determine filter radius */ @@ -2099,7 +2211,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) luxelFilterRadius = 1; /* allocate sampling flags storage */ - if(lightSamples > 1 && luxelFilterRadius == 0) + if((lightSamples > 1 || lightRandomSamples) && luxelFilterRadius == 0) { size = lm->sw * lm->sh * SUPER_LUXEL_SIZE * sizeof( unsigned char ); if(lm->superFlags == NULL) @@ -2119,7 +2231,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* get particulars */ lightLuxel = LIGHT_LUXEL( x, y ); - deluxel = SUPER_DELUXEL( x, y ); + lightDeluxel = LIGHT_DELUXEL( x, y ); origin = SUPER_ORIGIN( x, y ); normal = SUPER_NORMAL( x, y ); flag = SUPER_FLAG( x, y ); @@ -2149,10 +2261,12 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* add the contribution to the deluxemap */ if( deluxemap ) - VectorAdd( deluxel, trace.directionContribution, deluxel ); + { + VectorCopy( trace.directionContribution, lightDeluxel ); + } /* check for evilness */ - if(trace.forceSubsampling && lightSamples > 1 && luxelFilterRadius == 0) + if(trace.forceSubsampling > 1.0f && (lightSamples > 1 || lightRandomSamples) && luxelFilterRadius == 0) { totalLighted++; *flag |= FLAG_FORCE_SUBSAMPLING; /* force */ @@ -2170,7 +2284,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* secondary pass, adaptive supersampling (fixme: use a contrast function to determine if subsampling is necessary) */ /* 2003-09-27: changed it so filtering disamples supersampling, as it would waste time */ - if( lightSamples > 1 && luxelFilterRadius == 0 ) + if( (lightSamples > 1 || lightRandomSamples) && luxelFilterRadius == 0 ) { /* walk luxels */ for( y = 0; y < (lm->sh - 1); y++ ) @@ -2231,6 +2345,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) if(*flag & FLAG_ALREADY_SUBSAMPLED) // already subsampled continue; lightLuxel = LIGHT_LUXEL( sx, sy ); + lightDeluxel = LIGHT_DELUXEL( sx, sy ); origin = SUPER_ORIGIN( sx, sy ); /* only subsample shadowed luxels */ @@ -2238,7 +2353,10 @@ void IlluminateRawLightmap( int rawLightmapNum ) //% continue; /* subsample it */ - SubsampleRawLuxel_r( lm, &trace, origin, sx, sy, 0.25f * lightSamplesSearchBoxSize, lightLuxel ); + if(lightRandomSamples) + RandomSubsampleRawLuxel( lm, &trace, origin, sx, sy, 0.5f * lightSamplesSearchBoxSize, lightLuxel, deluxemap ? lightDeluxel : NULL ); + else + SubsampleRawLuxel_r( lm, &trace, origin, sx, sy, 0.25f * lightSamplesSearchBoxSize, lightLuxel, deluxemap ? lightDeluxel : NULL ); *flag |= FLAG_ALREADY_SUBSAMPLED; @@ -2306,6 +2424,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) { /* setup */ VectorClear( averageColor ); + VectorClear( averageDir ); samples = 0.0f; /* cheaper distance-based filtering */ @@ -2324,6 +2443,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) if( *cluster < 0 ) continue; lightLuxel = LIGHT_LUXEL( sx, sy ); + lightDeluxel = LIGHT_DELUXEL( sx, sy ); /* create weight */ weight = (abs( sx - x ) == luxelFilterRadius ? 0.5f : 1.0f); @@ -2332,6 +2452,11 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* scale luxel by filter weight */ VectorScale( lightLuxel, weight, color ); VectorAdd( averageColor, color, averageColor ); + if(deluxemap) + { + VectorScale( lightDeluxel, weight, direction ); + VectorAdd( averageDir, direction, averageDir ); + } samples += weight; } } @@ -2359,6 +2484,15 @@ void IlluminateRawLightmap( int rawLightmapNum ) luxel[ 1 ] += averageColor[ 1 ] / samples; luxel[ 2 ] += averageColor[ 2 ] / samples; } + + if(deluxemap) + { + /* scale into luxel */ + deluxel = SUPER_DELUXEL( x, y ); + deluxel[ 0 ] += averageDir[ 0 ] / samples; + deluxel[ 1 ] += averageDir[ 1 ] / samples; + deluxel[ 2 ] += averageDir[ 2 ] / samples; + } } /* single sample */ @@ -2366,7 +2500,9 @@ void IlluminateRawLightmap( int rawLightmapNum ) { /* get particulars */ lightLuxel = LIGHT_LUXEL( x, y ); + lightDeluxel = LIGHT_DELUXEL( x, y ); luxel = SUPER_LUXEL( lightmapNum, x, y ); + deluxel = SUPER_DELUXEL( x, y ); /* handle negative light */ if( trace.light->flags & LIGHT_NEGATIVE ) @@ -2382,6 +2518,11 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* handle normal light */ else VectorAdd( luxel, lightLuxel, luxel ); + + if(deluxemap) + { + VectorAdd( deluxel, lightDeluxel, deluxel ); + } } } } @@ -2390,6 +2531,9 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* free temporary luxels */ if( lightLuxels != stackLightLuxels ) free( lightLuxels ); + + if(deluxemap) + free( lightDeluxels ); } /* free light list */ @@ -2741,16 +2885,16 @@ void IlluminateVertexes( int num ) radVertLuxel[ 2 ] <= ambientColor[ 2 ] ) { /* nudge the sample point around a bit */ - for( x = 0; x < 4; x++ ) + for( x = 0; x < 5; x++ ) { /* two's complement 0, 1, -1, 2, -2, etc */ x1 = ((x >> 1) ^ (x & 1 ? -1 : 0)) + (x & 1); - for( y = 0; y < 4; y++ ) + for( y = 0; y < 5; y++ ) { y1 = ((y >> 1) ^ (y & 1 ? -1 : 0)) + (y & 1); - for( z = 0; z < 4; z++ ) + for( z = 0; z < 5; z++ ) { z1 = ((z >> 1) ^ (z & 1 ? -1 : 0)) + (z & 1); @@ -2763,6 +2907,21 @@ void IlluminateVertexes( int num ) trace.cluster = ClusterForPointExtFilter( origin, VERTEX_EPSILON, info->numSurfaceClusters, &surfaceClusters[ info->firstSurfaceCluster ] ); if( trace.cluster < 0 ) continue; + + /* r7 dirt */ + if( dirty && !bouncing ) + dirt = DirtForSample( &trace ); + else + dirt = 1.0f; + + /* jal: floodlight */ + floodLightAmount = 0.0f; + VectorClear( floodColor ); + if( floodlighty && !bouncing ) + { + floodLightAmount = floodlightIntensity * FloodLightForSample( &trace, floodlightDistance, floodlight_lowquality ); + VectorScale( floodlightRGB, floodLightAmount, floodColor ); + } /* trace */ LightingAtSample( &trace, ds->vertexStyles, colors ); @@ -2985,9 +3144,10 @@ SetupBrushes() determines opaque brushes in the world and find sky shaders for sunlight calculations */ -void SetupBrushes( void ) +void SetupBrushesFlags( int mask_any, int test_any, int mask_all, int test_all ) { - int i, j, b, compileFlags; + int i, j, b; + unsigned int compileFlags, allCompileFlags; qboolean inside; bspBrush_t *brush; bspBrushSide_t *side; @@ -3016,23 +3176,27 @@ void SetupBrushes( void ) /* check all sides */ inside = qtrue; compileFlags = 0; + allCompileFlags = ~(0u); for( j = 0; j < brush->numSides && inside; j++ ) { /* do bsp shader calculations */ side = &bspBrushSides[ brush->firstSide + j ]; shader = &bspShaders[ side->shaderNum ]; - + /* get shader info */ - si = ShaderInfoForShader( shader->shader ); + si = ShaderInfoForShaderNull( shader->shader ); if( si == NULL ) continue; /* or together compile flags */ compileFlags |= si->compileFlags; + allCompileFlags &= si->compileFlags; } + + Sys_FPrintf( SYS_VRB, "flags: %d (all: %d)\n", compileFlags, allCompileFlags ); /* determine if this brush is opaque to light */ - if( !(compileFlags & C_TRANSLUCENT) ) + if( (compileFlags & mask_any) == test_any && (allCompileFlags & mask_all) == test_all ) { opaqueBrushes[ b >> 3 ] |= (1 << (b & 7)); numOpaqueBrushes++; @@ -3043,6 +3207,10 @@ void SetupBrushes( void ) /* emit some statistics */ Sys_FPrintf( SYS_VRB, "%9d opaque brushes\n", numOpaqueBrushes ); } +void SetupBrushes( void ) +{ + SetupBrushesFlags(C_TRANSLUCENT, 0, 0, 0); +} @@ -3053,7 +3221,7 @@ determines if two clusters are visible to each other using the PVS qboolean ClusterVisible( int a, int b ) { - int portalClusters, leafBytes; + int leafBytes; byte *pvs; @@ -3070,7 +3238,7 @@ qboolean ClusterVisible( int a, int b ) return qtrue; /* get pvs data */ - portalClusters = ((int *) bspVisBytes)[ 0 ]; + /* portalClusters = ((int *) bspVisBytes)[ 0 ]; */ leafBytes = ((int*) bspVisBytes)[ 1 ]; pvs = bspVisBytes + VIS_HEADER_SIZE + (a * leafBytes); @@ -3374,7 +3542,7 @@ void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ) int i, x, y, z, x1, y1, z1; light_t *light, *light2, **owner; bspLeaf_t *leaf; - vec3_t origin, dir, mins, maxs, nullVector = { 0, 0, 0 }; + vec3_t origin, dir, mins, maxs; float radius, intensity; light_t *buckets[ 256 ]; @@ -3487,6 +3655,7 @@ void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ) /* check for fast mode */ if( !(light->flags & LIGHT_FAST) && !(light->flags & LIGHT_FAST_TEMP) ) light->envelope = MAX_WORLD_COORD * 8.0f; + intensity = light->photons; /* hopefully not used */ } else { @@ -3864,7 +4033,7 @@ void SetupFloodLight( void ) int i, j; float angle, elevation, angleStep, elevationStep; const char *value; - double v1,v2,v3,v4,v5; + double v1,v2,v3,v4,v5,v6; /* note it */ Sys_FPrintf( SYS_VRB, "--- SetupFloodLight ---\n" ); @@ -3898,8 +4067,9 @@ void SetupFloodLight( void ) v1=v2=v3=0; v4=floodlightDistance; v5=floodlightIntensity; + v6=floodlightDirectionScale; - sscanf( value, "%lf %lf %lf %lf %lf", &v1, &v2, &v3, &v4, &v5); + sscanf( value, "%lf %lf %lf %lf %lf %lf", &v1, &v2, &v3, &v4, &v5, &v6); floodlightRGB[0]=v1; floodlightRGB[1]=v2; @@ -3912,9 +4082,11 @@ void SetupFloodLight( void ) if (v4<1) v4=1024; if (v5<1) v5=128; + if (v6<0) v6=1; floodlightDistance=v4; floodlightIntensity=v5; + floodlightDirectionScale=v6; floodlighty = qtrue; Sys_Printf( "FloodLighting enabled via worldspawn _floodlight key.\n" ); @@ -4009,7 +4181,7 @@ float FloodLightForSample( trace_t *trace , float floodLightDistance, qboolean f TraceLine( trace ); contribution=1; - if (trace->compileFlags & C_SKY ) + if ( trace->compileFlags & C_SKY || trace->compileFlags & C_TRANSLUCENT ) { contribution=1.0f; } @@ -4193,7 +4365,7 @@ void FloodLightRawLightmap( int rawLightmapNum ) /* global pass */ if (floodlighty && floodlightIntensity) - FloodLightRawLightmapPass(lm, floodlightRGB, floodlightIntensity, floodlightDistance, floodlight_lowquality, 1.0f); + FloodLightRawLightmapPass(lm, floodlightRGB, floodlightIntensity, floodlightDistance, floodlight_lowquality, floodlightDirectionScale); /* custom pass */ if (lm->floodlightIntensity)