diff options
author | Ton Roosendaal <ton@blender.org> | 2008-01-28 19:33:59 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-01-28 19:33:59 +0300 |
commit | 703f248ab4bd918ba6a202a20b73dc6293851759 (patch) | |
tree | b25a9483434d28433780fd585ed5f29b3d3bcd06 /source/blender/nodes/intern/CMP_nodes/CMP_idMask.c | |
parent | b9842ec247e5ae9458f59d24e98973ca17949ae7 (diff) |
New rendering option: FSA!
This completes the pipeline make-over, as started in 2006. With this
option, during rendering, each sample for every layer and pass is being
saved on disk (looks like non-antialiased images). Then the composite
and color correction happens, then a clip to 0-1 range, and only in end
all samples get combined - using sampling filters such as gauss/mitch/catmul.
This results in artefact-free antialiased images. Even Z-combine or
ID masks now work perfect for it!
This is an unfinished commit btw; Brecht will finish this for strands.
Also Halo doesnt work yet.
To activate FSA: press "Save Buffers" and the new button next to it. :)
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; } |