more deluxemap+surfacelight fixes
This commit is contained in:
parent
c13784bc3a
commit
30a8c2c22c
|
|
@ -822,7 +822,7 @@ int LightContributionToSample( trace_t *trace )
|
||||||
angle = DotProduct( trace->normal, trace->direction );
|
angle = DotProduct( trace->normal, trace->direction );
|
||||||
|
|
||||||
/* twosided lighting */
|
/* twosided lighting */
|
||||||
if( trace->twoSided )
|
if( trace->twoSided && angle < 0 )
|
||||||
{
|
{
|
||||||
angle = -angle;
|
angle = -angle;
|
||||||
|
|
||||||
|
|
@ -836,8 +836,13 @@ int LightContributionToSample( trace_t *trace )
|
||||||
return 0;
|
return 0;
|
||||||
else if( angle < 0.0f &&
|
else if( angle < 0.0f &&
|
||||||
(trace->twoSided || (light->flags & LIGHT_TWOSIDED)) )
|
(trace->twoSided || (light->flags & LIGHT_TWOSIDED)) )
|
||||||
|
{
|
||||||
angle = -angle;
|
angle = -angle;
|
||||||
|
|
||||||
|
/* no deluxemap contribution from "other side" light */
|
||||||
|
doAddDeluxe = qfalse;
|
||||||
|
}
|
||||||
|
|
||||||
/* clamp the distance to prevent super hot spots */
|
/* clamp the distance to prevent super hot spots */
|
||||||
dist = sqrt(dist * dist + light->extraDist * light->extraDist);
|
dist = sqrt(dist * dist + light->extraDist * light->extraDist);
|
||||||
if( dist < 16.0f )
|
if( dist < 16.0f )
|
||||||
|
|
@ -878,6 +883,13 @@ int LightContributionToSample( trace_t *trace )
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* also don't deluxe if the direction is on the wrong side */
|
||||||
|
if(DotProduct(trace->normal, trace->direction) < 0)
|
||||||
|
{
|
||||||
|
/* no deluxemap contribution from "other side" light */
|
||||||
|
doAddDeluxe = qfalse;
|
||||||
|
}
|
||||||
|
|
||||||
/* ydnar: moved to here */
|
/* ydnar: moved to here */
|
||||||
add = factor * light->add;
|
add = factor * light->add;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user