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_zcombine.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_zcombine.c')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c index 29cf8f34d54..eb939100644 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c @@ -45,6 +45,16 @@ static bNodeSocketType cmp_node_zcombine_out[]= { { -1, 0, "" } }; +static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float *src2, float *z2) +{ + if(*z1 <= *z2) { + QUATCOPY(out, src1); + } + else { + QUATCOPY(out, src2); + } +} + static void do_zcombine_mask(bNode *node, float *out, float *z1, float *z2) { if(*z1 > *z2) { @@ -67,6 +77,8 @@ static void do_zcombine_add(bNode *node, float *out, float *col1, float *col2, f static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { + RenderData *rd= data; + /* stack order in: col z col z */ /* stack order out: col z */ if(out[0]->hasoutput==0) @@ -76,6 +88,16 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in if(in[0]->data==NULL) { return; } + else if(rd->scemode & R_FULL_SAMPLE) { + /* make output size of first input image */ + CompBuf *cbuf= in[0]->data; + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs + + composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, + in[3]->data, in[3]->vec, do_zcombine, CB_RGBA, CB_VAL, CB_RGBA, CB_VAL); + + out[0]->data= stackbuf; + } else { /* make output size of first input image */ CompBuf *cbuf= in[0]->data; |