alpha over and z-combine problems

I have gone a bit post crazy however I am putting together a short film and have hit a few stumbling blocks I was not expecting.

The biggest one at the moment is this one.

I have a billboard texture (2d animation with alpha) that interacts with the environment - ‘walking’ in front and behind objects.

I however wish the landscape (3d model) to have a defocus node - but I want the 2d animation to always be in focus (distance from camera will change little but I don’t want any fuzziness)

So I split the 2d animation and the 3d model onto two render layers and I used the Alpha over option to combine them, which worked great except that the 2d animation always appears ‘above’ the 3d environment. So I tried just the z-combine node however no alpha is carried over, so the billboard is solid.

So I applied the 2x z-combine + mapping negative values + alpha over nodes as per wiki Manual-Node-ZCombine_ex_alpha but the alpha over seems to leave behind traces of the alpha on the 2d animation billboard, i.e it is not 100% see through. Its like it tried but could not quite do it.

I do not understand why this is.

here is one with just the alpha over (works fine but no z depth cant move behind trees ‘walk’ into the distance etc.)
http://meanwhile.beds.ac.uk/dav/transok.jpg

here is same frame same portion with 2x z-combine + alpha +map value thing
http://meanwhile.beds.ac.uk/dav/transbill.jpg

Nothing else has been changed in the scene. you see it leaves the outline and has the billboard almost transparent.

Don’t use z-combine. For the render layer containing the billboard enable the AllZ button on the render layer tab and combine the render layers with an alpha over node or a mix node (set to Mix and 1.0, billboard layer in the bottom socket and “A” button in upper right corner enabled).

I had it set up with alpha over node working so I just turned on AIIZ and it looks like that has done everything I wanted !!! :smiley: thanks so much - Also I have noticed the defocus node leaves a lot of speckles ? is there anyway i can improve this when rendering ?

Turn off the preview button on the defocus node.