From 4feff63ffaec4d62d5bdfc85968cc99298907767 Mon Sep 17 00:00:00 2001 From: wwylele Date: Tue, 11 Jul 2017 22:19:00 +0300 Subject: SwRasterizer/Lighting: dist atten lut input need to be clamp --- src/video_core/swrasterizer/rasterizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index c83680629..37d1313cf 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -171,7 +171,7 @@ std::tuple, Math::Vec4> ComputeFragmentsColors( size_t lut = static_cast(LightingRegs::LightingSampler::DistanceAttenuation) + num; - float sample_loc = scale * distance + bias; + float sample_loc = MathUtil::Clamp(scale * distance + bias, 0.0f, 1.0f); u8 lutindex = static_cast(MathUtil::Clamp(std::floor(sample_loc * 256.0f), 0.0f, 255.0f)); -- cgit v1.2.3