How can I make an object only visible through certain material Hi I am trying to make a certain object only visible through another object with transparent material

lets say object named car and the other object named glass i can see the car if i look through glass but i can't see the car otherwise like looking through another glass or looking to car directly only looking through that glass shows me the car 

Basically Masking object's material transparency to another material

Example Image


How can i achieve this?
Any help is appreciated

Here is what i found with similar effect but only works with grease pencil

Here is what i found with similar effect but works for every glass material

I am new here so if i asked my question at the wrong place please correct me
It depends on your scene and what you need but you could use Light Paths node to make some condition that only one of your glass objects meet. For example you could have two glass planes, but one has another plane in front of it that has a transparent shader:



You can see the visibility of the orange shader is controlled by Light Paths node's transparency depth output that is 0 when we look through glass, but becomes 1 when there is a plane with transparent shader in front of that glass. You can see what happens if I move the transparent plane.