diff options
author | Matt Ebb <matt@mke3.net> | 2008-06-17 08:18:34 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2008-06-17 08:18:34 +0400 |
commit | 4c391a0c30018917f6173d1200efcb93c02211f5 (patch) | |
tree | 9435ae13a8353ad8ff3891639bbc983c612e536d /source/blender/nodes/intern/CMP_nodes/CMP_math.c | |
parent | 6be46f9ee3c29da2022e14bf812a5dac172453cb (diff) |
* Simple addition to math node (comp and shading): Greater Than and Less Than modes.
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes/CMP_math.c')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_math.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c index e317998b5fc..d00ce18a44f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c @@ -131,7 +131,23 @@ static void do_math(bNode *node, float *out, float *in, float *in2) { out[0]= (int)(in[0] + 0.5f); } - break; + break; + case 15: /* Less Than */ + { + if( in[0] < in2[0] ) + out[0]= 1.0f; + else + out[0]= 0.0f; + } + break; + case 16: /* Greater Than */ + { + if( in[0] > in2[0] ) + out[0]= 1.0f; + else + out[0]= 0.0f; + } + break; } } |