VectorCopy( trace->normal, normal );
/* check if the normal is aligned to the world-up */
- if( normal[ 0 ] == 0.0f && normal[ 1 ] == 0.0f )
+ if( normal[ 0 ] == 0.0f && normal[ 1 ] == 0.0f && ( normal[ 2 ] == 1.0f || normal[ 2 ] == -1.0f ) )
{
if( normal[ 2 ] == 1.0f )
{
/* global pass */
if (floodlighty && floodlightIntensity)
- FloodLightRawLightmapPass(lm, floodlightRGB, floodlightIntensity, floodlightDistance, floodlight_lowquality, 0);
+ FloodLightRawLightmapPass(lm, floodlightRGB, floodlightIntensity, floodlightDistance, floodlight_lowquality, 1.0f);
/* custom pass */
if (lm->floodlightIntensity)
float *luxel, *floodlight, *deluxel, *normal;
int *cluster;
float brightness;
- vec3_t lightvector;
int x, y, lightmapNum;
/* walk lightmaps */
if (luxel[3]==0) luxel[3]=1;
/* add to deluxemap */
- if (deluxemap && floodlight[3] > 0)
+ if (deluxemap && floodlight[3] > 0)\r
{
+ vec3_t lightvector;\r
+\r
normal = SUPER_NORMAL( x, y );
brightness = floodlight[ 0 ] * 0.3f + floodlight[ 1 ] * 0.59f + floodlight[ 2 ] * 0.11f;
- brightness *= ( 1.0f / 255.0f ) * floodlight[3];
+ brightness *= ( 1.0f / 255.0f ) * floodlight[3];\r
+\r
+ // use AT LEAST this amount of contribution from ambient for the deluxemap, fixes points that receive ZERO light\r
+ if(brightness < 0.00390625f)\r
+ brightness = 0.00390625f;\r
+\r
VectorScale( normal, brightness, lightvector );
VectorAdd( deluxel, lightvector, deluxel );
}