Alpha unsupported with Z pass

Hi everyone,

When I use compositor to visualize Z pass, it’s seem that an object with an alpha equal to zero can still be completely seen through this Z value and hide object(s) beside. It’s a problem when I use plane with transparent texture.

Is there any way to consider a completely transparent as “nothing” and show Z values from objects beside ?

Thanks in advance.

You could look at the Mist pass http://elysiun.com/forum/showthread.php?338395-Is-Cycles-Mist-pass-just-an-antialiased-Z-pass

For some reason, when I place an object beside the plane with part opaque part transparent texture, the opaque part is semi transparent when I render with mist. So, when I use mist pass, the result is strange.

Mist works as properly as it can. if your object is totally transparent it is represented correctly in the mist pass. if it is totally solid, that also works… when you have a mix… say its 30% transparent 70% solid, the pixel representation will be 30% of the object behind and 70% of the solid… giving an average for that area. If there is another method of representing both values, feel free to explain it / provide code.

Thanks to explain about that but actually, to simulate a mist, I was thinking about mixing the current object with the color background. Is that case, the object is mixed with the object color behind and became transparent.

Not sure if I understand your problem correctly, but alpha and Z-pass seem to work fine here (the leaf is an alpha mapped plane):


Make sure you have the alpha threshold set to a value larger than 0:


Here how it goes here :

Without mist :

With mist :

Has you can see, the object is perfectly opaque in the first one but transparent on the second one.
Also, I use the internal Renderer.

Remember : the problem asked at the beginning is how I can use completely transparent pixel with Z pass.

Actually, using Cycles solves my problem.

Thanks IkariShinji.

Well look at that I didn’t realise that the z depth issue for post was resolved with cycles, makes sense with proper camera rays I guess.