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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-03-05 13:44:42 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-03-05 13:44:42 +0300
commit63d8ccf9ffb18c8670292d8c57dbd85c629de485 (patch)
tree77ebe4f5f8bcb861f48f378618038f9b727f3b5e /source/blender/compositor/operations
parent9593a627465b70c4a999d0289a6283869d3eeaab (diff)
Fix T54225: Blur node stopped working when Map Range was fed with image
The issue was happening with fast Gaussian blur, and caused by NaN value pixels in the input buffer. Now made it so Map Range output does not produce NaN, by returning arbitrary value of 0. Still better than NaN!
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r--source/blender/compositor/operations/COM_MapRangeOperation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_MapRangeOperation.cpp b/source/blender/compositor/operations/COM_MapRangeOperation.cpp
index 7a89ba91b4c..7a38d066122 100644
--- a/source/blender/compositor/operations/COM_MapRangeOperation.cpp
+++ b/source/blender/compositor/operations/COM_MapRangeOperation.cpp
@@ -65,6 +65,11 @@ void MapRangeOperation::executePixelSampled(float output[4], float x, float y, P
dest_min = inputs[3];
dest_max = inputs[4];
+ if (fabsf(source_max - source_min) < 1e-6f) {
+ output[0] = 0.0f;
+ return;
+ }
+
if (value >= -BLENDER_ZMAX && value <= BLENDER_ZMAX) {
value = (value - source_min) / (source_max - source_min);
value = dest_min + value * (dest_max - dest_min);