hide the object behind transparent wall, keep environment visible

Hi :smile:

i’m currently development as an ARkit
I want to hide the object behind the transparent wall with the background visible. You can think of it as similar to the transparent cloak that appears in Harry Potter. Currently, I am thinking about using custom depth to specify the color of the area behind the wall, and then make the transparency of the color zero and remove the wall in front of me. However, I don’t know how to detect a particular color in the screen. Even if the color value is known, I don’t know if only the transparency of the color can be adjusted. It is also a problem that custom depth is not applied if it is transparent. So, to summarize…

  1. How to get color values from screen pixels
  2. How to cover only a specific mesh behind a transparent wall regardless of the background.
  3. Or there is any solution to remove mesh that overlapping with other mesh in camera view?
  4. Another Better ideas

I’d appreciate it if you gave me your opinion

Hi,
You can do this:
Add normal cube with transform similar to your translucent object, then disable Render In Main Pass on it - this way it will be invisible but Scene Depth will work on it. Now you can hide / unhide objects behind your translucent object using material with Depth test.

I don’t know if it will help you, but I prepared a training video similar to this.

2 Likes