Fix view distance light property from affecting brightness all of the time.
This commit is contained in:
@@ -63,7 +63,8 @@ protected:
|
||||
{
|
||||
const float dst2 = (float)Vector3::DistanceSquared(viewPosition, position);
|
||||
const float dst = Math::Sqrt(dst2);
|
||||
brightness *= Math::Remap(dst, 0.9f * ViewDistance, ViewDistance, 1.0f, 0.0f);
|
||||
if (dst < ViewDistance && dst > ViewDistance * 0.9f)
|
||||
brightness *= Math::Remap(dst, 0.9f * ViewDistance, ViewDistance, 1.0f, 0.0f);
|
||||
return dst < ViewDistance;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user