[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52682] trunk/blender/source/blender/ compositor/operations/COM_NormalizeOperation.cpp: Normalize node: clamp infinities to 0/1 (depending on sign)
Sergey Sharybin
sergey.vfx at gmail.com
Fri Nov 30 13:48:31 CET 2012
Revision: 52682
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52682
Author: nazgul
Date: 2012-11-30 12:48:30 +0000 (Fri, 30 Nov 2012)
Log Message:
-----------
Normalize node: clamp infinities to 0/1 (depending on sign)
The same behavior was in old compositor system and it makes more sense
when you're normalizing Z buffer.
Modified Paths:
--------------
trunk/blender/source/blender/compositor/operations/COM_NormalizeOperation.cpp
Modified: trunk/blender/source/blender/compositor/operations/COM_NormalizeOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_NormalizeOperation.cpp 2012-11-30 11:26:57 UTC (rev 52681)
+++ trunk/blender/source/blender/compositor/operations/COM_NormalizeOperation.cpp 2012-11-30 12:48:30 UTC (rev 52682)
@@ -43,6 +43,12 @@
this->m_imageReader->read(output, x, y, NULL);
output[0] = (output[0] - minmult->x) * minmult->y;
+
+ /* clamp infinities */
+ if (output[0] > 1.0f)
+ output[0] = 1.0f;
+ else if (output[0] < 0.0f)
+ output[0] = 0.0f;
}
void NormalizeOperation::deinitExecution()
More information about the Bf-blender-cvs
mailing list