summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-06-13 19:53:50 +0200
committerwwylele <wwylele@gmail.com>2017-07-11 18:39:15 +0200
commit37ac2b6657002e19d78cbc97841f8d3eee6ac5b8 (patch)
tree4ca5acd78e7dd9fe8c61703cba62a0032752f06f
parentSwRasterizer: Fixed a few conversion warnings and moved per-light values into the per-light loop. (diff)
downloadyuzu-37ac2b6657002e19d78cbc97841f8d3eee6ac5b8.tar
yuzu-37ac2b6657002e19d78cbc97841f8d3eee6ac5b8.tar.gz
yuzu-37ac2b6657002e19d78cbc97841f8d3eee6ac5b8.tar.bz2
yuzu-37ac2b6657002e19d78cbc97841f8d3eee6ac5b8.tar.lz
yuzu-37ac2b6657002e19d78cbc97841f8d3eee6ac5b8.tar.xz
yuzu-37ac2b6657002e19d78cbc97841f8d3eee6ac5b8.tar.zst
yuzu-37ac2b6657002e19d78cbc97841f8d3eee6ac5b8.zip
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index 54af53bbd..48ed8ccbf 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -175,12 +175,11 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
if (!lighting.IsDistAttenDisabled(num)) {
auto distance = (-view - position).Length();
float scale = Pica::float20::FromRaw(light_config.dist_atten_scale).ToFloat32();
- float dist_aten_bias =
- Pica::float20::FromRaw(light_config.dist_atten_scale).ToFloat32();
+ float bias = Pica::float20::FromRaw(light_config.dist_atten_bias).ToFloat32();
size_t lut =
static_cast<size_t>(LightingRegs::LightingSampler::DistanceAttenuation) + num;
- float sample_loc = scale * distance + dist_aten_bias;
+ float sample_loc = scale * distance + bias;
u8 lutindex =
static_cast<u8>(MathUtil::Clamp(std::floor(sample_loc * 256.f), 0.0f, 255.0f));