Revision: 37292
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37292
Author:   campbellbarton
Date:     2011-06-07 08:16:42 +0000 (Tue, 07 Jun 2011)
Log Message:
-----------
getting useful results out of the round compo node was tricky, use the second 
value to determine how much to round by (can be used like a posterize filter)

Modified Paths:
--------------
    trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c

Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c      
2011-06-07 07:57:26 UTC (rev 37291)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c      
2011-06-07 08:16:42 UTC (rev 37292)
@@ -140,7 +140,12 @@
                break;
        case 14: /* Round */
                {
-                               out[0]= floorf(in[0] + 0.5f);
+                       /* round by the second value */
+                       if( in2[0] != 0.0f )
+                               out[0]= floorf(in[0] / in2[0] + 0.5f) * in2[0];
+                       else
+                               floorf(in[0] + 0.5f);
+
                }
                break;
        case 15: /* Less Than */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to