diff options
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes/CMP_idMask.c')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_idMask.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c b/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c index abb9fa98d97..a40579ac3b2 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c @@ -63,8 +63,25 @@ static void do_idmask(CompBuf *stackbuf, CompBuf *cbuf, float idnr) MEM_freeN(abuf); } +/* full sample version */ +static void do_idmask_fsa(CompBuf *stackbuf, CompBuf *cbuf, float idnr) +{ + float *rect, *rs; + int x; + + rect= cbuf->rect; + rs= stackbuf->rect; + for(x= cbuf->x*cbuf->y - 1; x>=0; x--) + if(rect[x]==idnr) + rs[x]= 1.0f; + +} + + static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { + RenderData *rd= data; + if(out[0]->hasoutput==0) return; @@ -77,7 +94,10 @@ static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in, stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */; - do_idmask(stackbuf, cbuf, (float)node->custom1); + if(rd->scemode & R_FULL_SAMPLE) + do_idmask_fsa(stackbuf, cbuf, (float)node->custom1); + else + do_idmask(stackbuf, cbuf, (float)node->custom1); out[0]->data= stackbuf; } |