Composite Node Fails To Render Correctly

Hi All,

Playing around with nodes, I thought I’d try to mask an image with a simple circle shape.

I was supprised to see Blender fail in this simple task.

I have setup a render layer with the black and white output mapped to the alpha of the composite node. And while it shows up correctly in the nodes window, when I press F12 Blender does not composite it correctly. I also tried skipping the blur node and linking the alpha from the render layer directly to the composite node. This failed as well.

What am I doing wrong here?

Attachments


do it like this (see pic)

you have to overlay your your picture over something in order to see that the alpha is doing something.

your final render has indeed applied an alpha.
it´s just not premultiplied.
if you drag your mouse over the render you can see the rgb and alpha values at the bottom and see for yourself

Attachments


sigh I don’t think Blender failed in that simple task…

Ok,

I made some progress.
Here is an image of my revised nodes.

I appreciate your node post florianfelix, but it does not use an object inside blender, it relies on an external image. However, you are correct in the fact that the alpha is present, but not directly viewable in the blender render ouput window. I expected it to look just like the composite node preview. (So much for WYSIWYG software).

My goal here is to try to emulate an After Effects style masking system inside of blender. I thought if I could simply use flat objects and attach hooks to their verticies, I could animate the hooks and achieve an animated mask using the nodes. I could use the blur node to simulate the feather effect found in After Effects masking. I could use the scale node to simulate the mask contraction paramter as well.

The key to this approach is that you have to set the object index for the object that is going to become the mask and expose the object index in the render layers (in green). This way I could make use of the ID Mask node for generating my alpha.

My next problem is stacking.
I have added a RGB node into the layout, and I want my background color to be RED. But I can not figure out how to hook it into the layout to achieve this. I thought if I could have a background solid, I could visually detect my alpha working in the render window.

Does anyone know how to make the background of my node layout red?

Attachments


it’s a little devious, but use the alpha channel of the image to tell a mix node whether to use the image or the color. The trick is that the color has to be the BOTTOM socket of the Mix node. So you have to invert the alpha channel so that Alpha 1 is translated to 0 (use the top socket image) and where it is Alpha 0 to use the bottom socket (value 1). To turn a 0 into 1 and a 1 into 0, set the Map Value node to take the input, subtract 1, and multiply the result by -1. Feed that value as the Fac of the Mix node, and bingo.

Attachments


I haven’t read this whole thread but if you want to see alpha you have to alpha over something. I believe the terem you’re searching for is “Cropping” or “Slimming” as in cropping the RGB pixels from any place that’s zero alpha. You can do it in Blender via the paint tool in the uv/image editor window but it’s a job better suited to a still image editor like Photoshop or other various compositing apps.

Alternately you can simply add the image to the geometry as an image texture set to “Shadeless” and everything will be go-cat-go. Blender’s compositor just isn’t the right tool for that job.