[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51013] trunk/blender/source/blender/ compositor/operations/COM_MixGlareOperation.cpp: fix [#32739] Glare node does "add" instead of "lighten"

Campbell Barton ideasman42 at gmail.com
Wed Oct 3 09:33:05 CEST 2012


Revision: 51013
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51013
Author:   campbellbarton
Date:     2012-10-03 07:33:04 +0000 (Wed, 03 Oct 2012)
Log Message:
-----------
fix [#32739] Glare node does "add" instead of "lighten"

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/operations/COM_MixGlareOperation.cpp

Modified: trunk/blender/source/blender/compositor/operations/COM_MixGlareOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_MixGlareOperation.cpp	2012-10-03 05:49:22 UTC (rev 51012)
+++ trunk/blender/source/blender/compositor/operations/COM_MixGlareOperation.cpp	2012-10-03 07:33:04 UTC (rev 51013)
@@ -40,9 +40,13 @@
 	value = inputValue[0];
 	float mf = 2.f - 2.f * fabsf(value - 0.5f);
 	
-	output[0] = mf * ((inputColor1[0]) + value * (inputColor2[0] - inputColor1[0]));
-	output[1] = mf * ((inputColor1[1]) + value * (inputColor2[1] - inputColor1[1]));
-	output[2] = mf * ((inputColor1[2]) + value * (inputColor2[2] - inputColor1[2]));
+	if (inputColor1[0] < 0.0f) inputColor1[0] = 0.0f;
+	if (inputColor1[1] < 0.0f) inputColor1[1] = 0.0f;
+	if (inputColor1[2] < 0.0f) inputColor1[2] = 0.0f;
+
+	output[0] = mf * max(inputColor1[0] + value * (inputColor2[0] - inputColor1[0]), 0.0f);
+	output[1] = mf * max(inputColor1[1] + value * (inputColor2[1] - inputColor1[1]), 0.0f);
+	output[2] = mf * max(inputColor1[2] + value * (inputColor2[2] - inputColor1[2]), 0.0f);
 	output[3] = inputColor1[3];
 
 	clampIfNeeded(output);




More information about the Bf-blender-cvs mailing list