Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--intern/cycles/util/util_math.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index dc211d2ed4e..737c834e073 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -363,8 +363,13 @@ ccl_device_inline float pingpongf(float a, float b)
ccl_device_inline float smoothminf(float a, float b, float k)
{
- float h = fmaxf(k - fabsf(a - b), 0.0f) / k;
- return fminf(a, b) - h * h * h * k * (1.0f / 6.0f);
+ if (k != 0.0f) {
+ float h = fmaxf(k - fabsf(a - b), 0.0f) / k;
+ return fminf(a, b) - h * h * h * k * (1.0f / 6.0f);
+ }
+ else {
+ return fminf(a, b);
+ }
}
ccl_device_inline float signf(float f)