Search Unity

Projecting Transparency onto Meshes (Creating see through Walls)

Discussion in 'Shaders' started by lolgiggleman, May 17, 2020.

  1. lolgiggleman

    lolgiggleman

    Joined:
    May 2, 2012
    Posts:
    8
    Hi all

    I have a concept in my head that I can't quite figure out how to approach. I've attached a picture for a better explanation, but essentially, a player can point a 'torch' that will make the object it touches invisible. I'm NOT trying to create a portal, but instead just make the wall transparent.

    Viewport.png
    My idea from making this work would be to duplicate the player's camera in place, and to fire a raycast directly ahead. The Raycast would turn off the mesh renderer for that object, but only for that extra camera. I'd then apply a circular mask or something similar to the extra camera so it doesn't just make the entire object invisible.

    Has anyone ever tried something like this before,and if so, how did you go about it? Likewise, if you have any ideas on how to make this work, I'd love to hear them.

    Cheers.
     
  2. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350