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:
authorSam Miller <samuelmiller>2021-02-08 15:32:57 +0300
committerJacques Lucke <jacques@blender.org>2021-02-08 15:33:23 +0300
commitbb0b250cbded8bb89d89e67cc2b39826bf3f7fa6 (patch)
treeb28c10b6c2d8711e544755404e724bc9afb2fbad
parent4402f43b7119c8ee1e76fdb261454e04e4bb9520 (diff)
Fix T85368: map range node clamps incorrectly in geometry nodesdf0bce3f7d0
When clamp is enabled, it should clamp between the output min and max and not between 0 and 1. Differential Revision: https://developer.blender.org/D10324
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_map_range.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_map_range.cc b/source/blender/nodes/shader/nodes/node_shader_map_range.cc
index 4a6c9ec9a4d..c01e390c513 100644
--- a/source/blender/nodes/shader/nodes/node_shader_map_range.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_map_range.cc
@@ -122,7 +122,8 @@ class MapRangeFunction : public blender::fn::MultiFunction {
if (clamp_) {
for (int64_t i : mask) {
- CLAMP(results[i], 0.0f, 1.0f);
+ results[i] = (to_min[i] > to_max[i]) ? clamp_f(results[i], to_max[i], to_min[i]) :
+ clamp_f(results[i], to_min[i], to_max[i]);
}
}
}