From a2006ca4af36e4636af6316162d3de421a48aa8b Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 28 Feb 2023 22:36:43 +0100 Subject: [PATCH] Make sure MMBlurSlope uses the sigma paramater the intended way. --- modules/material_maker/nodes/filter/blur_slope.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/material_maker/nodes/filter/blur_slope.cpp b/modules/material_maker/nodes/filter/blur_slope.cpp index bd90de4be..056c288ad 100644 --- a/modules/material_maker/nodes/filter/blur_slope.cpp +++ b/modules/material_maker/nodes/filter/blur_slope.cpp @@ -123,6 +123,7 @@ Color MMBlurSlope::slope_blur(const Vector2 &uv, const float psize) { float v = sigma->get_value(uv); float sx = sigma->get_value(uv + Vector2(dx, 0.0)); float sy = sigma->get_value(uv + Vector2(0.0, dx)); + float sigma_orig = sigma->get_default_float(); Vector2 slope = Vector2(sx - v, sy - v); float slope_strength = slope.length() * psize; @@ -130,7 +131,7 @@ Color MMBlurSlope::slope_blur(const Vector2 &uv, const float psize) { Vector2 e = dx * norm_slope; Color rv = Color(); float sum = 0.0; - float sigma = MAX(v * slope_strength, 0.0001); + float sigma = MAX(sigma_orig * slope_strength, 0.0001); for (float i = 0.0; i <= 50.0; i += 1.0) { float coef = exp(-0.5 * (pow(i / sigma, 2.0))) / (6.28318530718 * sigma * sigma);