/* add to light direction map (fixme: use luxel normal as starting point for deluxel?) */
if( deluxemap )
{
- /* color to grayscale (photoshop rgb weighting) */
- brightness = trace.color[ 0 ] * 0.3f + trace.color[ 1 ] * 0.59f + trace.color[ 2 ] * 0.11f;
- brightness *= (1.0 / 255.0);
- VectorScale( trace.direction, brightness, trace.direction );
- VectorAdd( deluxel, trace.direction, deluxel );
+ if(DotProduct(normal, trace.direction) > 0) // do not take light from the back side
+ {
+ /* color to grayscale (photoshop rgb weighting) */
+ brightness = trace.color[ 0 ] * 0.3f + trace.color[ 1 ] * 0.59f + trace.color[ 2 ] * 0.11f;
+ brightness *= (1.0 / 255.0);
+ VectorScale( trace.direction, brightness, trace.direction );
+ VectorAdd( deluxel, trace.direction, deluxel );
+ }
}
}
}