[Bf-committers] Zcombine node + alpha channel issue

Cédric PAILLE cedricpaille at gmail.com
Mon Apr 14 11:42:59 CEST 2008


Hi,

I was playing with this node, add saw that the alpha channel for each images
was not taken into account.
I use an external renderer (Pixie) with my Blender rib exporter and export Z
and A channels and when I motion blur, the result is not what I expected
(only Z do the mask).

I made this tweak to CMP_zcombine.c to make it work:

static void do_zcombine(bNode *node, float *out, float *src1, float *z1,
float *src2, float *z2)
{
    if(*z1 <= *z2) {
        out[0] = (src1[3]*src1[0]) + ((1-src1[3]) * src2[0]);
        out[1] = (src1[3]*src1[1]) + ((1-src1[3]) * src2[1]);
        out[2] = (src1[3]*src1[2]) + ((1-src1[3]) * src2[2]);
        out[3] = (src1[3]) + ((1-src1[3]) * src2[3]);
    }
    else {
        out[0] = (src2[3]*src2[0]) + ((1-src2[3]) * src1[0]);
        out[1] = (src2[3]*src2[1]) + ((1-src2[3]) * src1[1]);
        out[2] = (src2[3]*src2[2]) + ((1-src2[3]) * src1[2]);
        out[3] = (src2[3]) + ((1-src2[3]) * src1[3]);

        if(node->custom1)
            *z1= *z2;
    }
}

But It works only when "Save Buffers" and "Full Sample" is enabled on the
"output" render panel.

The other case seems a bit harder to code (with the current implementation).

One last thing, can someone look at
http://projects.blender.org/tracker/index.php?func=detail&aid=8557&group_id=9&atid=127and
tell me if the python particle patch can be added in the SVN?

Best regards.

-- 
Cedric PAILLE.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-committers/attachments/20080414/71a47525/attachment.htm 


More information about the Bf-committers mailing list