Simple opacity material in cycles? Does anybody know how to achieve a "simple" opacity material in cycles? I'm fully aware of transparent node and mixing it with different shaders, but that's not what I'm looking for, for various reasons.

I'm looking for a diffuse material that treats all the faces it's applied to as a whole, and just simply reduces their opacity like in Photoshop. Below is a rough example of what I'm talking about:



So what's the main difference here is that with transparency node you can see through the faces and also see all the underlying geometry, and I don't want that. (for aesthetic reasons) What I want is a material like on the right, but without the hassle of different renderlayers and compositing.

I guess this might be too much to ask, but I just feel like maybe it could be done with some crazy node setup in cycles?
Now I feel dumb because I just realised how you can do this after posting the question.. :P
Anyways, here's one way to do it:

It's actually really simple node setup. You just have to combine a diffuse/transparent mix with a fully transparent node, and use transparency depth as a factor.



That way cycles disregards anything that is behind the first "layer" of transparency. Here's the result:



It's a much cleaner and nicer opacity-like transparency for many cases. I'll use it for illustrative/instructional animations and motion graphics, since those are all areas where simplicity is very important and transparent materials are often needed.

And best of all, you are saved from setting up different renderlayers and compositing nodes, and it also reduces rendertimes in many cases because there's no need for multiple renders!