I want to create a transparent material (glass shader) that doesn’t allow objects behind it to appear. I know that sounds weird, but it’s important for what I want to do (rendering gems set in metal, it doesn’t look right if you can see the metal thru the gems).
So far, I have only been able to accomplish this by setting the materials of all of the objects behind the glass/gem objects to “transparent” if the transmission ray bounces are greater than zero. But I would like to make it a property of the glass/gem object, because, what If I want to render say a pane of glass in front of the metal? With my set up, the object (a ring, usually) will disappear behind the glass. So, I only want CERTAIN glass/gem objects to not allow objects behind them to be seen. (I can get by with my current set up, but it would be better if I could solve this issue). Also, you can see how the gems dull out if you can see the objects behind them.
Any way to do what I’m wanting to do (make the gems themselves block out materials behind them)?
The render below is using simple glass shaders for the diamonds and glass panes. The gold setting on the left is using a simple glossy shader. The gold setting on the right (the one that disappears behind the pane of glass), is a glossy shader mixed with a transparent shader that kicks in if there are any transmission ray bounces (the node set up is below).