aboutsummaryrefslogtreecommitdiff
path: root/mp/src/utils/vrad/vraddetailprops.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/utils/vrad/vraddetailprops.cpp')
-rw-r--r--mp/src/utils/vrad/vraddetailprops.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/mp/src/utils/vrad/vraddetailprops.cpp b/mp/src/utils/vrad/vraddetailprops.cpp
index 93232595..c782ca29 100644
--- a/mp/src/utils/vrad/vraddetailprops.cpp
+++ b/mp/src/utils/vrad/vraddetailprops.cpp
@@ -738,7 +738,9 @@ void ComputeIndirectLightingAtPoint( Vector &position, Vector &normal, Vector &o
ColorRGBExp32ToVector( *pLightmap, lightmapColor );
}
- VectorMultiply( lightmapColor, dtexdata[pTex->texdata].reflectivity, lightmapColor );
+ float invLengthSqr = 1.0f / (1.0f + ((vEnd - position) * surfEnum.m_HitFrac / 128.0).LengthSqr());
+ // Include falloff using invsqrlaw.
+ VectorMultiply( lightmapColor, invLengthSqr * dtexdata[pTex->texdata].reflectivity, lightmapColor );
VectorAdd( outColor, lightmapColor, outColor );
}