So I need an alpha channel. My question is, how exactly do I convert the black areas of the picture to an alpha of 0? What should the blending mode be? Is it better to use a sprite than a billboard?

If it's a static image, you'd be best off editing it to have an alpha channel, and then setting the alpha appropriately. That's beyond the scope of this reply, of course :)

Next best, you're gonna have to filter the image -- you want blend mode to be Over (so that alpha is honoured), and you need to generate the alpha data.

To generate the alpha data, you'll want to whip up a core image filter, like this:

kernel vec4 darkToTransparent(sampler image)
{
        vec4 color = sample(image, samplerCoord(image));
        color.a = (color.r+color.g+color.b) > 0.005 ? 1.0:0.;
        return color;
}

the 0.005 is the cutoff -- depending on your hardware, image, and color depth, you may need to set this higher to properly cut out the black parts.

Hope that helps -- there's probably a better way out there, but this should get you started at least.

--
[ christopher wright ]
[EMAIL PROTECTED]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to