[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60906] trunk/blender/intern/cycles/kernel /shaders/node_math.osl: Fix for OSL bug reported on IRC by Pablo Vasquez: Clamp option of the math node in OSL produces bad results.

Lukas Toenne lukas.toenne at googlemail.com
Wed Oct 23 13:30:18 CEST 2013


Revision: 60906
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60906
Author:   lukastoenne
Date:     2013-10-23 11:30:18 +0000 (Wed, 23 Oct 2013)
Log Message:
-----------
Fix for OSL bug reported on IRC by Pablo Vasquez: Clamp option of the math node in OSL produces bad results. Really stupid bug, OSL math node was assigning the clamped 1st input value instead of the
clamped result of the actual operation.

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/shaders/node_math.osl

Modified: trunk/blender/intern/cycles/kernel/shaders/node_math.osl
===================================================================
--- trunk/blender/intern/cycles/kernel/shaders/node_math.osl	2013-10-23 10:35:49 UTC (rev 60905)
+++ trunk/blender/intern/cycles/kernel/shaders/node_math.osl	2013-10-23 11:30:18 UTC (rev 60906)
@@ -95,6 +95,6 @@
 		Value = safe_modulo(Value1, Value2);
 
 	if (Clamp)
-		Value = clamp(Value1, 0.0, 1.0);
+		Value = clamp(Value, 0.0, 1.0);
 }
 




More information about the Bf-blender-cvs mailing list