I would like to switch the material of one object (A - blue square) to transparent if this objects is between another object (B - gray sphere) and the camera. (It's a complex object so switching by "facing normals" are not working).
There are examples with the Texture Coordinate node but these examples are only show the relation of two objects.
I have two objects but the material must be also dependent on the camera view direction. How can I achieve this?
Also, what is the meaning of the Camera option in the Texture Coordinate node? The documentation states: "Position coordinate in camera space."
I thought it means, the position of the object the Texture Coordinate node refers to in camera space. This would be great, because I could compare them directly (A closer to the camera than B or the other way round, depending from which side I look) but I'm not able to get it to work.

