# Compositing fog destroys PNG alpha in Images as Planes when using Cycles

I'm following Andrew Price's spaceship tutorial and taking advantage of the inbuilt addon called Import Images as Planes.

Here you can see 2 Images as Planes used for the steam columns, close to the door.
If you ask why?, it's because I already have enough polygons, for my laptop to render...
And I thought that a smoke simulation would simply be an overkill.

Issue:

I wanted to try compositing, even if I'm still not ready with the definitive geometries and textures.
And... All is fine except for mist.

You can see I can use some Blur and Glare withuot big issues (apart the orange LED wall panels which became white - so I thought to assign them a different Material Pass and a separate ID Mask - now they are pinkish, but not so bad at all).

But! If I enable the Map Value node, which creates the mist... what happens it that the steam columns contours are MANGLED (well, not only the contours)!!

Now, is there a way to fix this issue (is it a bug or am I doing something wrong?) or do I have to give up and sacrifice that wornderful oniric mist?

[EDIT]

To whom can be interested in: the original blend is here (much better han mine).

Here's the Steam column I used for both Images as Planes:

You can't see it because it's white on a transparent background, resulting in white on white.

• If i understand your setup, your problem is not alpha but MatID mask with AA. try to change your final add node(s) for mix node(s). – Bithur Mar 12 '15 at 12:36
• I'll try, thank you. Allow me 1 hour to try. – Fantômas Mar 12 '15 at 12:55
• Could you post a .blend file? It would make it much easier to test, thanks :D – GiantCowFilms Mar 12 '15 at 13:53
• That's too bad, could you upload your file like GCF suggested? You can simplify it and remove non applicable things you don't want to share, just make sure the issue is present in the file you send. – VRM Mar 12 '15 at 14:16
• OK, thank you. Now please give me about an hour. Since I'm also doing some other things in the moment being. – Fantômas Mar 12 '15 at 14:25

The problem is Z Channel in Cycles - it does not take into account material transparency:

I recommend not using the Z channel pass but to render nice custom Z pass like this:

Assign this material to scene objects (this material has value based of ray length - distance to camera):

You will get nice anti-aliased Z-depth render that you can use for the mist. For alpha-transparent planes mix in Transparent shader like in the image and render them on separate render layer so there's nothing behind them (then composite them back in).

To create group node group them with Ctrl+G. Go inside and outside group node with Tab.

• Is Z_Depht a standard node in Blender? And Group Input? I guess I never noticed them, before. As I said, it's only 4 months I started with Blender. – Fantômas Mar 12 '15 at 14:30
• The Z_Depth node is a group (user made), the second image shows what's inside. The Group inputs are the inputs you see for the Z_Depth node in the 1st image. – Bithur Mar 12 '15 at 14:42
• Let me try to recreate this structure. – Fantômas Mar 12 '15 at 15:48
• OK, done, trying to render an Image-Plane with this new material... Emission instead of Diffuse? How funny! But maybe it's due to Cycles youth? – Fantômas Mar 12 '15 at 16:10
• @DerGolem Well you don't need any lights for this material - the front will be shadeless white (emission) and the back will be black(no material there). You can also input the shaders the other way round for inverted result. Then you just play with farpoint and contrast to adjust the mapping. – Jaroslav Jerryno Novotny Mar 12 '15 at 16:29